Post meta disappearing after reloading the post editor

Support Meta Box AIO Post meta disappearing after reloading the post editor

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49799
    SridharSridhar
    Participant

    Meta Box AIO version 3.5.1

    WP 6.9.4

    CPT: https://sri.smmall.cloud/MTc3MzYzMzI4MjQyOQ

    Field group for posts: https://sri.smmall.cloud/MTc3MzYzMzMyNzE3OQ

    Problem: After a post is selected as the value of the "Post Author" field by editing a post and saved, the selected value does not stick/remain after reloading the page.

    Screencast: https://kommodo.ai/recordings/O8n8MnNEsgGlV0vukqNJ?onlyRecording=1

    #49803
    PeterPeter
    Moderator

    Hello Sridhar,

    It doesn't work because of the field ID post_author. In WordPress, post_author is not a normal custom field. It is a core column in the wp_posts table and doesn't work when you enable "Author" feature for the CPT.

    If you want to use the custom field and save the value to the database, table wp_postmeta, there are 2 ways:

    1. Use a different field ID, like post_meta_author
    2. Go to Meta Box > Post types > Edit CPT > Supports tab > Disable option "Author".

    A similar issue will happen if you use the following field IDs:

    post_author
    post_title
    post_status
    post_name
    post_date
    #49807
    SridharSridhar
    Participant

    Thank you Peter.

    You may want to add client-side and server-side validation to ensure that reserved keywords are not used as field IDs.

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