• Resolved rarcher30

    (@rarcher30)


    Hi there.
    This may have been asked before, but is there a way to combine the custom post api data (i.e. rendered, excerpt, feat image) along with all the acf data that has been attached to the custom post type?

    Right now, I have to use two separate JSON feeds generated via the REST API:
    * one from the native WP support
    * and the other from your plugin to expose the acf api

    Would love to have it all combined/condensed into one feed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author airesvsg

    (@airesvsg)

    Hi @rarcher30,

    All natives endpoints of WordPress expose the Advanced Custom Fields, like:
    http://localhost/wp-json/v2/posts/{post_id}

    Other endpoints:
    https://github.com/airesvsg/acf-to-rest-api#endpoints

    Thanks

    marcosaccioly

    (@marcosaccioly)

    Hey guys,

    I’m able to use the endpoints, but there is a crucial difference between the native endpoint and ACF endpoint:

    1. I need the custom field (photo) URL in the JSON, but the native API only returns numbers (I’m assuming they are field IDs), like this: "foto_do_aluno":["513","513"],"_foto_do_aluno":["field_5922eb4fd4e36","field_5922eb4fd4e36"]
    2. ACF endpoint returns the url correctly, but not the other native fields (title, etc): "acf":{"foto_do_aluno":"http:\/\/localhost\/profuncionario\/wp-content\/uploads\/2017\/08\/Gabriela-Rodrigues-dos-Santos-1-500x500.jpg",

    How to have both the native fields (like “title”) and the custom field photo URL?

    Plugin Author airesvsg

    (@airesvsg)

    Hi @marcosaccioly,

    The native endpoint answer isn’t right.

    Whats the versions of WordPress and ACF?

    Thanks

    marcosaccioly

    (@marcosaccioly)

    ACF 5.5.11, WP 4.7.4.

    Plugin Author airesvsg

    (@airesvsg)

    @marcosaccioly Please, update your WordPress and ACF.

    Can you send me your files and database dump? I’ll test in my local.

    [email protected]

    Thanks

    • This reply was modified 8 years ago by airesvsg.
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Combine acf with post api’ is closed to new replies.