On this page
WP_REST_Server::set_status( int $code )
Sends an HTTP status code.
Parameters
$codeint Required-
HTTP status.
Source
File: wp-includes/rest-api/class-wp-rest-server.php. View all references
protected function set_status( $code ) {
status_header( $code );
}
Related
Uses
| Uses | Description |
|---|---|
| status_header() wp-includes/functions.php | Sets HTTP status header. |
Used By
| Used By | Description |
|---|---|
| WP_REST_Server::serve_request() wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
| WP_REST_Server::json_error() wp-includes/rest-api/class-wp-rest-server.php | Retrieves an appropriate error representation in JSON. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_server/set_status