Moving data from custom fields tied to a page

Support General Moving data from custom fields tied to a pageResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #41368
    SolaceSolace
    Participant

    Hi there! So there are two ways to use custom fields right now. I can create a custom post type and attach the custom fields to the post type (call it FAQ) and it will show up as menu item. I can also create just the custom fields and attach them to a specific page (say Page A). However in the second scenario I'm not able to move the data from Page A to Page B. Page B can show the custom fields but not the data. How can I get this data to be shown on Page A and Page B using the second scenario and not manually copying and pasting content between the pages?

    #41377
    PeterPeter
    Moderator

    Hello,

    The custom field ID and value are saved in the database, table wp_postmeta with the format meta_key: meta_value and they are associated with the post by ID. So if you want to display the same field value on page B as page A, you need to copy the value to the field on page B.
    If you don't want to do that manually, you can use the code. Please read more on the documentation
    https://docs.metabox.io/functions/rwmb-set-meta/
    https://developer.wordpress.org/reference/functions/update_post_meta/

    #41468
    SolaceSolace
    Participant

    Got it Peter, will look into it and let you know if I need a hand. Thanks!

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