Home Forums Front-end Issues wp_remote_get ACF fields


wp_remote_get ACF fields

    • jarvis

    • June 18, 2020 at 9:17 pm

    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!

    • jarvis

    • June 19, 2020 at 12:32 am

    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.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.