Support

Account

Home Forums Front-end Issues wp_remote_get ACF fields

Helping

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!
    Thanks

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

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

The topic ‘wp_remote_get ACF fields’ is closed to new replies.