Home › Forums › Front-end Issues › Relationship posts private? › Reply To: Relationship posts private?
so:
$talks = get_field('conference_talks', false, false);
print_r($talks);
Array
(
[0] => 3997
[1] => 3998
[2] => 3996
[3] => 3995
[4] => 3994
)
as opposed to:
$talks = get_field('conference_talks');
print_r($talks);
Array
(
)
so it at least returns something, but it has appeared to caused some of the other custom fields to return incorrect values.
Update:
I guess the other fields were messed up because it was no longer return the post object and instead the post ID (aside: I’m guessing this is similar to changing the Return Format from Post Objects to Post IDs) so where before I had things like:
$user = get_field('talk_speaker');
the_field('talk_description');
I now need:
$user = get_field('talk_speaker', $post);
the_field('talk_description', $post);
which I have done and seems to have everything working.
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.