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.



git-svn-id: https://develop.svn.wordpress.org/trunk@39056 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2016-10-31 11:10:37 +00:00
parent 0153b0bb9b
commit d66ba1ee7a
2 changed files with 23 additions and 0 deletions
@@ -1010,6 +1010,9 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
'type' => 'string',
),
'context' => array( 'edit' ),
'arg_options' => array(
'sanitize_callback' => 'wp_parse_slug_list',
),
),
'password' => array(
'description' => __( 'Password for the resource (never included).' ),