On this page
wp_xmlrpc_server::error( IXR_Error|string $error, false $message = false )
Send error response to client.
Description
Send an XML error response to the client. If the endpoint is enabled an HTTP 200 response is always sent per the XML-RPC specification.
Parameters
$errorIXR_Error|string Required-
Error code or an error object.
$messagefalse Optional-
Error message. Optional.
Default:
false
Source
File: wp-includes/class-wp-xmlrpc-server.php. View all references
public function error( $error, $message = false ) {
// Accepts either an error object or an error code and message
if ( $message && ! is_object( $error ) ) {
$error = new IXR_Error( $error, $message );
}
if ( ! $this->is_enabled ) {
status_header( $error->code );
}
$this->output( $error->getXml() );
}
Related
Uses
| Uses | Description |
|---|---|
| status_header() wp-includes/functions.php | Sets HTTP status header. |
| IXR_Error::__construct() wp-includes/IXR/class-IXR-error.php | PHP5 constructor. |
Changelog
| Version | Description |
|---|---|
| 5.7.3 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/error