rest-filter icon indicating copy to clipboard operation
rest-filter copied to clipboard

Doesn't work with WP_REST_Request

Open rmtngh opened this issue 9 years ago • 1 comments

$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.

rmtngh avatar Jan 11 '17 23:01 rmtngh

The parameter's name is filter, and the value is an object. Try $request->set_param( 'filter', [ 'name' => 'home' ] );

rmccue avatar Jan 11 '17 23:01 rmccue