mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
REST API: Add support for arrays in schema validation and sanitization.
By allowing more fine-grained validation and sanitisation of endpoint args, we can ensure the correct data is being passed to endpoints. This can easily be extended to support new data types, such as CSV fields or objects. Props joehoyle, rachelbaker, pento. Fixes #38531. git-svn-id: https://develop.svn.wordpress.org/trunk@39046 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1006,6 +1006,9 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
'roles' => array(
|
||||
'description' => __( 'Roles assigned to the resource.' ),
|
||||
'type' => 'array',
|
||||
'items' => array(
|
||||
'type' => 'string',
|
||||
),
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
'password' => array(
|
||||
|
||||
Reference in New Issue
Block a user