trackback_response

The timeline below displays how wordpress function trackback_response has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param int|bool $error         Whether there was an error.
 *                                Default '0'. Accepts '0' or '1', true or false.
 * @param string   $error_message Error message if an error occurred. Default empty string.
 */
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>';
    }
}

WordPress Version: 5.4

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param int|bool $error         Whether there was an error.
 *                                Default '0'. Accepts '0' or '1', true or false.
 * @param string   $error_message Error message if an error occurred.
 */
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>';
    }
}

WordPress Version: 5.1

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param mixed  $error         Whether there was an error.
 *                              Default '0'. Accepts '0' or '1', true or false.
 * @param string $error_message Error message if an error occurred.
 */
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>';
    }
}

WordPress Version: 4.1

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param mixed  $error         Whether there was an error.
 *                              Default '0'. Accepts '0' or '1', true or false.
 * @param string $error_message Error message if an error occurred.
 */
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>";
    }
}

WordPress Version: 3.7

/**
 * Response to a trackback.
 *
 * Responds with an error or success XML message.
 *
 * @since 0.71
 *
 * @param int|bool $error         Whether there was an error.
 *                                Default '0'. Accepts '0' or '1'.
 * @param string   $error_message Error message if an error occurred.
 */
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>";
    }
}