Home Forums Front-end Issues wp_remote_get ACF fields


wp_remote_get ACF fields

  • Hi All,

    I’m really hoping someone can point out the obvious.

    I’m pulling in data from one site to another. So I’ve used wp_remote_get

    The file one site A has all the ACF fields exposed and if I view the JSON the URL has ACF and then lists all the fields

    Site B which will receive the posts has
    $remote_posts = json_decode( $response['body'] );

    If I dump out $remote_posts, I see all the usual things (ID, title, Content, Excerpt, Slug etc.) But I don’t see any ACF fields? Yet they’re exposed as I can see them from the source on Site A

    I can output a title, for example:
    echo '<h2>'. $remote_post->title->rendered . '</h2>';

    But if I do the same for an ACF field, for example:
    echo '<p>' . $remote_post->ACF->town . '</p>';
    Nothing is displayed

    Feeling pretty daft and know it’s something obvious

    Any help is much appreciated!

  • It’s ok, I found the issue, was a code discrepancy

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

You must be logged in to reply to this topic.