WordPress开发者和主题制作者的搜索引擎



trackback_response ›

Since0.71
已弃用n/a
trackback_response ( $error = 0, $error_message = '' )
参数: (2)
  • (mixed) $error Whether there was an error. Default '0'. Accepts '0' or '1', true or false.
    Required: No
    默认:
  • (string) $error_message Error message if an error occurred.
    Required: No
    默认: (empty)
定义在:
文档:

Response to a trackback.

Responds with an error or success XML message.



源码

function trackback_response( $error = 0, $error_message = '' ) {
	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );
	if ( $error ) {
		echo '<?xml version="1.0" encoding="utf-8"?' . ">\n";
		echo "<response>\n";
		echo "<error>1</error>\n";
		echo "<message>$error_message</message>\n";
		echo '</response>';
		die();
	} else {
		echo '<?xml version="1.0" encoding="utf-8"?' . ">\n";
		echo "<response>\n";
		echo "<error>0</error>\n";
		echo '</response>';
	}
}