rest_ensure_request( array|WP_REST_Request $request )
Ensures request arguments are a request object (for consistency).
Parameters
- $request
-
(Required) Request to check.
Return
(WP_REST_Request) REST request instance.
Source
File: wp-includes/rest-api.php
function rest_ensure_request( $request ) {
if ( $request instanceof WP_REST_Request ) {
return $request;
}
return new WP_REST_Request( 'GET', '', $request );
}
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |