Support

Account

Home Forums General Issues update_field with post_object

Helping

update_field with post_object

    • Rank

    • September 17, 2013 at 9:52 pm

    I have several posts to insert a custom field, use the ‘post object’ in the case, as I use the update field for post object?
    What I am trying to use:

    $supplier_one = 'my supplier';
    $supplier_two = 'my supplier TWO';
    $post_id_one = 555;
    $post_id_two = 556;
    
    update_field('suppliers', $supplier_one, $post_id_one)
    update_field('suppliers', $supplier_two, $post_id_two)
    • Elliot

    • September 18, 2013 at 12:27 pm

    Hi @Rank

    To save the value of a post_object field, you should save the ID of the post.
    If the field has been set as a multiple value field, you need to save an array of post ID’s

    Does this help?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.