wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



trackback_response › WordPress Function

Da0.71
Deprecaton/a
› trackback_response ( $error = 0, $error_message = '' )
Parametri: (2)
  • (int|bool) $error Whether there was an error. Default 0. Accepts 0 or 1, true or false.
    Richiesto: No
    Default: —
  • (string) $error_message Error message if an error occurred. Default empty string.
    Richiesto: No
    Default: (vuoto)
Ritorna:
  • (void) Never returns if `$error` is truthy, as the function dies after
    sending the error response.
Definito a:
Codex:

Response to a trackback.

Responds with an error or success XML message.


Sorgenti

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>' . esc_xml( $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>';
	}
}