admin管理员组

文章数量:1130349

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.

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.

本文标签: actionsin the post adminis it possible to make the post title input disabled using php