Advertisements

trackback_response

Definition:
function trackback_response($error = 0, $error_message = '') {}

trackback_response() – Respond with error or success XML message

Parameters

  • int|bool $error: Whether there was an error
  • string $error_message: Error message if an error occurred

Source code

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>";

	}

}

3073

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: