Support » Plugin: WordPress REST API (Version 2) » WordPress 4.7: Custom taxonomy filter stopped working

  • Hi!

    I just updated my website (on local host) to 4.7. I use the API call to retrieve posts from an CPT, filtered on a custom taxonomy. This looks like:
    /wp-json/wp/v2/reizen-api?filter[reizen-land]=test123

    ‘reizen-api’ is the rest_base of my CPT. ‘reizen-land’ is the custom taxonomy.

    This used to work well before the update (and works again when downgrading to 4.6.1.).

    However, in 4.7 it doesn’t seem to filter on the custom taxonomy. Is this an issue that is caused by the WP update?

    Thanks!

Viewing 4 replies - 16 through 19 (of 19 total)
  • Oh yeah that’s a great idea.

    Hi all,
    I followed your suggestions, but I can’t make it work for an URL like:

    wp-json/wp/v2/professionals?filter[posts_per_page]=-1&filter[meta_query][0][key]=blabla&filter[meta_query][0][value]=sarasa&filter[meta_query][0][compare]==

    I’m not sure if the code is taking effect or not, is there any way to be sure about that?
    Your solution is very useful, thanks!

    amindiary

    (@amindiary)

    @aaylersghost saved my day! thank you.

    Found a solution here: https://github.com/WP-API/rest-filter/issues/3#issuecomment-268342560

    but it only seems to work with syntax like: wp-json/wp/v2/professionals?filter[posts_per_page]=-1&filter[meta_query][0][key]=blabla&filter[meta_query][0][value]=sarasa&filter[meta_query][0][compare]==

    rather than: /wp-json/wp/v2/reizen-api?filter[reizen-land]=test123

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘WordPress 4.7: Custom taxonomy filter stopped working’ is closed to new replies.