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:
Timothy Jacobs
2021-11-09 01:57:48 +00:00
parent 29615a6c70
commit ecf1d6a158
13 changed files with 188 additions and 9 deletions
@@ -1523,6 +1523,8 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase {
$data = $response->get_data();
$properties = $data['schema']['properties'];
$this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] );
$this->assertCount( 7, $properties );
$this->assertArrayHasKey( 'id', $properties );
$this->assertArrayHasKey( 'id_base', $properties );