REST API Changes in 5.4

REST API Changes in 5.4

Author: WordPress.org

Date: February 29, 2020 

Category: Make WordPress Core

(advertorial)

wprssaggregator REST API Changes in 5.4
Taxonomy “OR” Relation Now Supported in Posts Controller

Querying for /wp/v2/posts?tags=1&categories=2 returns all posts assigned the tag with ID 1, AND assigned the category with ID 2. This AND relationship, where multiple taxonomies’ term relationships must all be satisfied, has been the only supported behavior in these collection endpoints since WordPress 4.7.

The REST API /wp/v2/posts endpoint, as well as custom post type endpoints extending from WP_REST_Posts_Controller (including custom post types specifying “show_in_rest” => true), now supports a new tax_relation parameter which can be used to return posts matching either taxonomy filter, rather than both.

As an example, in WordPress

This is the first part of the original article by WordPress.org.
Click here to read the full article in a new tab!

(advertorial)

toolset logo tag line white REST API Changes in 5.4

REST API Changes in 5.4

World of WordPress is hosted by:

Servebolt: next level high performance hosting.

While others try to add more components to their hosting to make it go faster, we decided to build our hosting cloud fast from the ground up. We did so by stripping out everything we knew was deadweight.