_xmlrpc_wp_die_handler

Kill WordPress execution and display XML message with error message.

Description

_xmlrpc_wp_die_handler( (string) $message, (string) $title = '', (array) $args = array() ); 

This is the handler for wp_die when processing XMLRPC requests.

Parameters (3)

0. $message (string)
Error message.
1. $title — Optional. (string) => ''
Error title. Default empty.
2. $args — Optional. (array) => array()
Arguments to control behavior. Default empty array.

Usage

  1. if ( !function_exists( '_xmlrpc_wp_die_handler' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // Error message. 
  5. $message = ''; 
  6.  
  7. // Optional. Error title. Default empty. 
  8. $title = ''; 
  9.  
  10. // Optional. Arguments to control behavior. Default empty array. 
  11. $args = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = _xmlrpc_wp_die_handler($message, $title, $args); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { 
  2. global $wp_xmlrpc_server; 
  3. $defaults = array( 'response' => 500 ); 
  4.  
  5. $r = wp_parse_args($args, $defaults); 
  6.  
  7. if ( $wp_xmlrpc_server ) { 
  8. $error = new IXR_Error( $r['response'] , $message); 
  9. $wp_xmlrpc_server->output( $error->getXml() ); 
  10. die();