_xmlrpc_wp_die_handler

函式
_xmlrpc_wp_die_handler ( $message, $title = '', $args = array() )
Access
Private
引數
  • (string) $message Error message.
    Required:
  • (string) $title Optional. Error title. Default empty.
    Required:
    Default: (empty)
  • (string|array) $args Optional. Arguments to control behavior. Default empty array.
    Required:
    Default: array()
定義位置
相關方法
_xml_wp_die_handler_ajax_wp_die_handler_jsonp_wp_die_handler_scalar_wp_die_handler_json_wp_die_handler
引入
3.2.0
棄用
-

_xmlrpc_wp_die_handler: 該函式與_xml_wp_die_handler函式類似,但專門用於在通過SSL連線的XML-RPC請求中發生的錯誤。

殺死WordPress的執行,並顯示帶有錯誤資訊的XML響應。

這是處理XMLRPC請求時wp_die()的處理程式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
global $wp_xmlrpc_server;
list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
if ( ! headers_sent() ) {
nocache_headers();
}
if ( $wp_xmlrpc_server ) {
$error = new IXR_Error( $parsed_args['response'], $message );
$wp_xmlrpc_server->output( $error->getXml() );
}
if ( $parsed_args['exit'] ) {
die();
}
}
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { global $wp_xmlrpc_server; list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); if ( ! headers_sent() ) { nocache_headers(); } if ( $wp_xmlrpc_server ) { $error = new IXR_Error( $parsed_args['response'], $message ); $wp_xmlrpc_server->output( $error->getXml() ); } if ( $parsed_args['exit'] ) { die(); } }
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
	global $wp_xmlrpc_server;

	list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );

	if ( ! headers_sent() ) {
		nocache_headers();
	}

	if ( $wp_xmlrpc_server ) {
		$error = new IXR_Error( $parsed_args['response'], $message );
		$wp_xmlrpc_server->output( $error->getXml() );
	}
	if ( $parsed_args['exit'] ) {
		die();
	}
}

常見問題

FAQs
檢視更多 >