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



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.

  • When registering the post type, just don't add title to supports. – Jacob Peattie Nov 30 '18 at 12:24
  • I still want to support it so the user can see the generated title, but just need the post title input disabled. – joshmoto Nov 30 '18 at 12:33
  • 1
    add your own meta box that displays the auto-generated title. – Milo Nov 30 '18 at 20:41
  • Thanks milo yeah this is my fall back but I might just use javascript, I was curios wether there was action to rebuild the native post title field :-) – joshmoto Nov 30 '18 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.