I am using the repeater field. As a sub field, I would like to allow the user to select another post or page. In the code, the value I would like to return for that page is just the ID number – nothing fancy, no titles, links images, etc. For example, if the post’s ID number is 179, I just want to return the 179. (Kind of like in the image field, when you have the choice to return the image_id as the result, and all you get is the number.)
But I’m having a hard time trying to figure out how to do this. I don’t even have sample code to start from. I assume the answer is simple, but I can’t find it.
From the post_object array, how do you return the post’s ID within a repeater field? What would that look like?
Viewing 1 post (of 1 total)
The topic ‘Using post_object in repeater field to get page id?’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users