trackback_response() WordPress Function

The trackback_response() function is used to send a trackback response to a trackback caller. This function is not intended to be called directly.

trackback_response( int|bool $error, string $error_message = '' ) #

Response to a trackback.


Description

Responds with an error or success XML message.


Top ↑

Parameters

$error

(int|bool)(Required)Whether there was an error. Default '0'. Accepts '0' or '1', true or false.

$error_message

(string)(Optional)Error message if an error occurred.

Default value: ''


Top ↑

Source

File: wp-trackback.php

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>';
	}
}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.