Doesn't work with WP_REST_Request #8

rmtngh opened this Issue Jan 11, 2017 · 1 comment


None yet

2 participants

rmtngh commented Jan 11, 2017

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

rmccue commented Jan 11, 2017

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

@rmccue rmccue closed this Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment