• I am working with an editorial brand to launch their new website using WordPress as a backend and CMS but with Node/Express middleware and an Angular front end via the WP REST API.

    An important part of any editorial is post curation; in our case, we have sections for Featured, Latest, and Popular. On their current website, they use the Zone Manager (Zoninator) plugin for this purpose.

    However, the WP REST API is unable to access the data of the Zone Manager to see what posts should currently be Featured/Popular/Latest, and so I have no way of pulling the correct posts to our Landing Page. If the Zone Manager injected some kind of flag into the JSON Post Object, everything would be fine, but it does not do that. We contemplated using specific categories to denote these zones, but this is not an ideal solution.

    Is there any way to write a custom endpoint for the WP REST API that would be able to call posts that are only present in certain zones? I’m a JavaScript guy with no PHP experience so I recognize I will have some difficulties in doing so, but I need to know if this is even possible first.

    Any additional advice or ideas are welcomed too.

    https://www.ads-software.com/plugins/rest-api/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Zoninator generates JSON feeds for each zone: /zones/{zone-slug}/feed.json

    We also have some PRs in progress to add REST API endpoints for zones: https://github.com/Automattic/zoninator/pull/43

    However, it sounds like you want the standard posts endpoint(s) to include zone information instead of accessing a separate endpoint to fetch posts in a zone?

    Thread Starter cortharlow12

    (@cortharlow12)

    This is actually really funny because I almost emailed you yesterday about this very thing but didn’t want to impede on your time!

    But actually no, I want a separate endpoint to fetch posts in a zone so those endpoints would work for me perfectly – is there any way I can get access to those endpoints?

    I’d start with the existing JSON feeds to see if those can work for you.

    There’s still some testing that needs to be done on the REST API endpoints, but we’d love any feedback if you want to test them them out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Endpoint for Plugin Data’ is closed to new replies.