Custom Fields
Support General Problem with title clearing on Dashboard update

  • Creator
  • #26636
    Resolved Martin


    I'm having essentially the same issue as with this topic -

    The solution worked fine for when the form is used in the frontend but in the CPT edit screen it still clears the title when I update. I've created the text field with id post_title and when I let it remain visible I can see that it doesn't populate in the backend dashboard and I'm assuming that's why it clears the title on update.

    I think from the other topic that I need to have the attribute post_id='current' but as the Dashboard isn't using the shortcode for display I'm not sure how to apply this (assuming that will work in the Dashboard as well).


Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #26651
    Long Nguyen

    Hi Martin,

    The custom field with the ID post_title only works on the frontend (just a trick). On the backend, WordPress has the main field (pre-built) post_title so it does not show the custom field with the same ID.

    You can also follow this solution to only use the custom field and remove the main field Post Title

    Add this code to the file functions.php or use the plugin Code Snippets.

    add_action( 'init', function () {
        remove_post_type_support( 'post', 'title' );
    } );

    That helped a lot. Thanks.

    I managed to use this information to extend things a little and generate an automated title based on other fields in the CPT.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.