Sends error response to client.
Sends an XML error response to the client. If the endpoint is enabled an HTTP 200 response is always sent per the XML-RPC specification.
$errorIXR_Error|stringrequired
$messagefalseoptional
Default:false
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() );
}
| Version | Description |
|---|---|
| 5.7.3 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/error