REST API: Allow a CSV list of user roles to be passed to `/users`.

After [39048], this changes explicitly parses the list of user roles as slugs, and adds tests.

Props jnylen0.
Fixes #38557.


Built from https://develop.svn.wordpress.org/trunk@39056


git-svn-id: http://core.svn.wordpress.org/trunk@38998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2016-10-31 11:11:29 +00:00
parent 9862543913
commit 03e34ab461
2 changed files with 4 additions and 1 deletions

View File

@ -1010,6 +1010,9 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
'type' => 'string', 'type' => 'string',
), ),
'context' => array( 'edit' ), 'context' => array( 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'wp_parse_slug_list',
),
), ),
'password' => array( 'password' => array(
'description' => __( 'Password for the resource (never included).' ), 'description' => __( 'Password for the resource (never included).' ),

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-beta1-39055'; $wp_version = '4.7-beta1-39056';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.