Skip to content

Commit b474a90

Browse files
authored
Merge pull request #7 from spacedmonkey/feature/40365-rest-sites-endpoint-v2
Define allow_batch support for site endpoints
2 parents 21377c7 + 13b9603 commit b474a90

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎src/wp-includes/rest-api/endpoints/class-wp-rest-sites-controller.php‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
*/
1717
class WP_REST_Sites_Controller extends WP_REST_Controller {
1818

19+
/**
20+
* Whether the controller supports batching.
21+
*
22+
* @since 7.2.0
23+
* @var false
24+
*/
25+
protected $allow_batch = false;
26+
1927
/**
2028
* Instance of a site meta fields object.
2129
*
@@ -60,7 +68,8 @@ public function register_routes() {
6068
'permission_callback' => array( $this, 'create_item_permissions_check' ),
6169
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
6270
),
63-
'schema' => array( $this, 'get_public_item_schema' ),
71+
'allow_batch' => $this->allow_batch,
72+
'schema' => array( $this, 'get_public_item_schema' ),
6473
)
6574
);
6675

@@ -72,7 +81,7 @@ public function register_routes() {
7281
$this->namespace,
7382
'/' . $this->rest_base . '/(?P<id>[\d]+)',
7483
array(
75-
'args' => array(
84+
'args' => array(
7685
'id' => array(
7786
'description' => __( 'Unique identifier for the object.' ),
7887
'type' => 'integer',
@@ -104,7 +113,8 @@ public function register_routes() {
104113
),
105114
),
106115
),
107-
'schema' => array( $this, 'get_public_item_schema' ),
116+
'allow_batch' => $this->allow_batch,
117+
'schema' => array( $this, 'get_public_item_schema' ),
108118
)
109119
);
110120
}

0 commit comments

Comments
 (0)