Make WordPress Core


Ignore:
Timestamp:
06/02/2024 08:01:44 PM (2 years ago)
Author:
TimothyBlynJacobs
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r57239 r58283  
    181181                $response = rest_get_server()->dispatch( $request );
    182182                $data     = $response->get_data();
     183                $this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] );
    183184                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
    184185                $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
     
    187188                $response = rest_get_server()->dispatch( $request );
    188189                $data     = $response->get_data();
     190                $this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] );
    189191                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
    190192                $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
Note: See TracChangeset for help on using the changeset viewer.