Changeset 58283
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r57648 r58283 24 24 */ 25 25 protected $meta; 26 27 /** 28 * Whether the controller supports batching. 29 * 30 * @since 6.6.0 31 * @var array 32 */ 33 protected $allow_batch = array( 'v1' => true ); 26 34 27 35 /** … … 62 70 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), 63 71 ), 64 'schema' => array( $this, 'get_public_item_schema' ), 72 'allow_batch' => $this->allow_batch, 73 'schema' => array( $this, 'get_public_item_schema' ), 65 74 ) 66 75 ); … … 108 117 ), 109 118 ), 110 'schema' => array( $this, 'get_public_item_schema' ), 119 'allow_batch' => $this->allow_batch, 120 'schema' => array( $this, 'get_public_item_schema' ), 111 121 ) 112 122 ); -
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r57239 r58283 181 181 $response = rest_get_server()->dispatch( $request ); 182 182 $data = $response->get_data(); 183 $this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] ); 183 184 $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); 184 185 $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); … … 187 188 $response = rest_get_server()->dispatch( $request ); 188 189 $data = $response->get_data(); 190 $this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] ); 189 191 $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); 190 192 $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); -
trunk/tests/qunit/fixtures/wp-api-generated.js
r58232 r58283 9372 9372 "GET" 9373 9373 ], 9374 "allow_batch": { 9375 "v1": true 9376 }, 9374 9377 "args": { 9375 9378 "context": { … … 9515 9518 "POST" 9516 9519 ], 9520 "allow_batch": { 9521 "v1": true 9522 }, 9517 9523 "args": { 9518 9524 "username": { … … 9617 9623 "GET" 9618 9624 ], 9625 "allow_batch": { 9626 "v1": true 9627 }, 9619 9628 "args": { 9620 9629 "id": { … … 9642 9651 "PATCH" 9643 9652 ], 9653 "allow_batch": { 9654 "v1": true 9655 }, 9644 9656 "args": { 9645 9657 "id": { … … 9734 9746 "DELETE" 9735 9747 ], 9748 "allow_batch": { 9749 "v1": true 9750 }, 9736 9751 "args": { 9737 9752 "id": {
Note: See TracChangeset
for help on using the changeset viewer.