actions - in the post admin, is it possible to make the post title input disabled using php?

admin2025-06-05  2

I am customising my product post type and auto generating the post title using add_action('acf/save_post').

See my php below for this...

class Product {

    /**
     * product constructor method.
     */
    public function __construct() {

        // process product details when saving the post
        add_action('acf/save_post', array($this,'action_product_title'), 20);

    }

    /**
     * Action to run modifications when saving the post
     * @return void
     */
    public function action_product_title ($post_id) {

        // my product title modifications...

        // finally, return
        return;

    }

}

new Product();

My question is, is there a hook or action that I can add to my construct to make the post title input field disabled using php.

The idea being, the post title input is still visible, but the input is disabled from manual editing.

Thanks in advance for any help.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749137560a316678.html

最新回复(0)