REST API: Add batch support to the Users API.
Developers can now include /wp/v2/users routes when making a batch API request. Props alexminza, timothyblynjacobs, mukesh27. Fixes #60895. Built from https://develop.svn.wordpress.org/trunk@58283 git-svn-id: http://core.svn.wordpress.org/trunk@57743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
53e041b361
commit
21978f3c31
|
@ -24,6 +24,14 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||||
*/
|
*/
|
||||||
protected $meta;
|
protected $meta;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the controller supports batching.
|
||||||
|
*
|
||||||
|
* @since 6.6.0
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $allow_batch = array( 'v1' => true );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -61,6 +69,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
|
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
|
||||||
),
|
),
|
||||||
|
'allow_batch' => $this->allow_batch,
|
||||||
'schema' => array( $this, 'get_public_item_schema' ),
|
'schema' => array( $this, 'get_public_item_schema' ),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -107,6 +116,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
'allow_batch' => $this->allow_batch,
|
||||||
'schema' => array( $this, 'get_public_item_schema' ),
|
'schema' => array( $this, 'get_public_item_schema' ),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.6-alpha-58282';
|
$wp_version = '6.6-alpha-58283';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue