WP_REST_Server::set_status() WordPress Method
The WP_REST_Server::set_status() function is used to set the HTTP status code for the current request. This is useful for indicating errors or other status conditions when handling a request.
WP_REST_Server::set_status( int $code ) #
Sends an HTTP status code.
Parameters
- $code
(int)(Required)HTTP status.
Source
File: wp-includes/rest-api/class-wp-rest-server.php
protected function set_status( $code ) { status_header( $code ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |