rest_handle_deprecated_argument

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

WordPress Version: 6.2

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function_name The function that was called.
 * @param string $message       A message regarding the change.
 * @param string $version       Version.
 */
function rest_handle_deprecated_argument($function_name, $message, $version)
{
    if (!WP_DEBUG || headers_sent()) {
        return;
    }
    if ($message) {
        /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function_name, $version, $message);
    } else {
        /* translators: 1: Function name, 2: WordPress version number. */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function_name, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}

WordPress Version: 5.5

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function    The function that was called.
 * @param string $message     A message regarding the change.
 * @param string $version     Version.
 */
function rest_handle_deprecated_argument($function, $message, $version)
{
    if (!WP_DEBUG || headers_sent()) {
        return;
    }
    if ($message) {
        /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function, $version, $message);
    } else {
        /* translators: 1: Function name, 2: WordPress version number. */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}

WordPress Version: 5.3

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function    The function that was called.
 * @param string $message     A message regarding the change.
 * @param string $version     Version.
 */
function rest_handle_deprecated_argument($function, $message, $version)
{
    if (!WP_DEBUG || headers_sent()) {
        return;
    }
    if (!empty($message)) {
        /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function, $version, $message);
    } else {
        /* translators: 1: Function name, 2: WordPress version number. */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}

WordPress Version: 4.8

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function    The function that was called.
 * @param string $message     A message regarding the change.
 * @param string $version     Version.
 */
function rest_handle_deprecated_argument($function, $message, $version)
{
    if (!WP_DEBUG || headers_sent()) {
        return;
    }
    if (!empty($message)) {
        /* translators: 1: function name, 2: WordPress version number, 3: error message */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function, $version, $message);
    } else {
        /* translators: 1: function name, 2: WordPress version number */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}

WordPress Version: 4.5

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function    The function that was called.
 * @param string $message     A message regarding the change.
 * @param string $version     Version.
 */
function rest_handle_deprecated_argument($function, $message, $version)
{
    if (!empty($message)) {
        /* translators: 1: function name, 2: WordPress version number, 3: error message */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function, $version, $message);
    } else {
        /* translators: 1: function name, 2: WordPress version number */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}

WordPress Version: 4.4

/**
 * Handles _deprecated_argument() errors.
 *
 * @since 4.4.0
 *
 * @param string $function    Function name.
 * @param string $replacement Replacement function name.
 * @param string $version     Version.
 */
function rest_handle_deprecated_argument($function, $replacement, $version)
{
    if (!empty($replacement)) {
        /* translators: 1: function name, 2: WordPress version number, 3: new argument name */
        $string = sprintf(__('%1$s (since %2$s; %3$s)'), $function, $version, $replacement);
    } else {
        /* translators: 1: function name, 2: WordPress version number */
        $string = sprintf(__('%1$s (since %2$s; no alternative available)'), $function, $version);
    }
    header(sprintf('X-WP-DeprecatedParam: %s', $string));
}