mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
REST API: Add batch support for posts and terms controllers.
This also exposes the value of `allow_batch` in `OPTIONS` requests to a route. A future commit will add batch support to more resources. Props spacedmonkey, chrisvanpatten. See #53063. git-svn-id: https://develop.svn.wordpress.org/trunk@52068 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -24,6 +24,14 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
|
||||
*/
|
||||
protected $widgets_retrieved = false;
|
||||
|
||||
/**
|
||||
* Whether the controller supports batching.
|
||||
*
|
||||
* @since 5.9.0
|
||||
* @var array
|
||||
*/
|
||||
protected $allow_batch = array( 'v1' => true );
|
||||
|
||||
/**
|
||||
* Widgets controller constructor.
|
||||
*
|
||||
@@ -56,7 +64,7 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
|
||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(),
|
||||
),
|
||||
'allow_batch' => array( 'v1' => true ),
|
||||
'allow_batch' => $this->allow_batch,
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
@@ -90,7 +98,7 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
|
||||
),
|
||||
),
|
||||
),
|
||||
'allow_batch' => array( 'v1' => true ),
|
||||
'allow_batch' => $this->allow_batch,
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user