trackback_response

Advertisement

Summery Summery

Response to a trackback.

Syntax Syntax

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

Description Description

Responds with an error or success XML message.

Parameters Parameters

$error

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

$error_message

(Optional) Error message if an error occurred.

Default value: ''

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

Advertisement

Changelog Changelog

Changelog
Version Description
0.71 Introduced.

Advertisement

Leave a Reply