getting post data in custom field

Support MB Custom Table getting post data in custom field

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49622
    aryanrajaryanraj
    Participant

    Hi, i have a custom field text book_title(read only) which is empty. I want to automatically assign the post_title value here in database. How can i do that? It is un custom table so i need to copy the post_title as book_title.

    #49626
    PeterPeter
    Moderator

    Hello,

    There isn't an option to assign the post title to book title value in the database directly. If you are familiar with coding, you can try to use the action hook rwmb_after_save_field to update field value after saving the post. Following the documentation https://docs.metabox.io/actions/rwmb-after-save-field/

    #49627
    aryanrajaryanraj
    Participant

    Should i use rwmb_after_save_field or rwmb_after_save_post? also if you could share a function. it would be really useful for us.

    The reason is i don't want to write the book title again as it is already saving in post_title in wp_posts but it is not in custom table so i can export in csv.

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