Home › Forums › General Issues › Post object in Flexible Content › Reply To: Post object in Flexible Content
This is getting your post object field
$ctrlid = get_sub_field('agrement_du_centre');
What is this field set to return?
In any case this will not return anything because the value returned above is either an id or a post object.
$post_object = get_field(' . $ctrlid . ');
Taking a wild guess by looking at this since you named the value $ctrlid
that you are returning the post ID then you would get fields from this other post by using
get_field('field-name-on-other-post', $ctrlid);
on the other hand if $ctrlid
is a post object then you’d use
get_field('field-name-on-other-post', $ctrlid->ID);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.