trackback_response

Response to a trackback.

Description

trackback_response( (int) $error = 0, (string) $error_message = '' ); 

Responds with an error or success XML message.

Parameters (2)

0. $error — Optional. (int)
Whether there was an error. Default 0.. Accepts 0. or 1 , true or false.
1. $error_message — Optional. (string) => ''
Error message if an error occurred.

Usage

  1. if ( !function_exists( 'trackback_response' ) ) { 
  2. require_once '/wp-trackback.php'; 
  3.  
  4. // Whether there was an error. 
  5. // Default '0'. Accepts '0' or '1', true or false. 
  6. $error = -1; 
  7.  
  8. // Error message if an error occurred. 
  9. $error_message = ''; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = trackback_response($error, $error_message); 
  13.  

Defined (1)

The function is defined in the following location(s).

/wp-trackback.php  
  1. function trackback_response($error = 0, $error_message = '') { 
  2. header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); 
  3. if ($error) { 
  4. echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; 
  5. echo "<response>\n"; 
  6. echo "<error>1</error>\n"; 
  7. echo "<message>$error_message</message>\n"; 
  8. echo "</response>"; 
  9. die(); 
  10. } else { 
  11. echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; 
  12. echo "<response>\n"; 
  13. echo "<error>0</error>\n"; 
  14. echo "</response>";