WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2018 08:56:58 AM (3 years ago)
Author:
pento
Message:

REST API: Introduce the rest_preload_api_request() function.

This function helps perform multiple REST API requests, for the purpose of preloading data into a page.

See #45110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/tests/phpunit/tests/rest-api.php

    r41744 r43763  
    594594        $this->assertEquals( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
    595595    }
     596
     597    /**
     598     * Ensure rest_preload_api_request() works without notices in PHP 5.2.
     599     *
     600     * The array_reduce() function only accepts mixed variables starting with PHP 5.3.
     601     */
     602    function test_rest_preload_api_request_no_notices_php_52() {
     603        $this->assertTrue( is_array( rest_preload_api_request( 0, '/' ) ) );
     604    }
    596605}
Note: See TracChangeset for help on using the changeset viewer.