rest-filter
rest-filter copied to clipboard
Doesn't work with WP_REST_Request
$request = new WP_REST_Request( 'GET', '/wp/v2/pages' ); $request->set_param( 'filter[name]', 'home' );
This will return all pages in response, instead of "home' only.
The parameter's name is filter, and the value is an object. Try $request->set_param( 'filter', [ 'name' => 'home' ] );