WordPress.org

Forums

WP REST API (WP API)
Querying posts according to custom taxonomy term? (2 posts)

  1. mompracem
    Member
    Posted 1 year ago #

    Does the api support the same query vars as standard WordPress queries?

    suppose I have a taxonomy called location, normally in WordPress I would write

    www.mysite.com/?location=my-term

    to get results for "my-term" taxonomy archive

    I tried to do that with the JSON API

    www.mysite.com/wp-json.php/posts/?location=my-term

    but it doesn't work - is this supported?

    https://wordpress.org/plugins/json-rest-api/

  2. kiubmen
    Member
    Posted 7 months ago #

    Try this:
    http://www.mysite.com/wp-json/posts?filter[location]=my-term

    Syntax:
    http://api-endpint/wp-json/posts?filter[query-variable]=value

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP REST API (WP API)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic