Support

Account

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.