_deprecated_file

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

WordPress Version: 6.4

/**
 * Marks a file as deprecated and inform when it has been used.
 *
 * There is a {@see 'deprecated_file_included'} hook that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @since 5.4.0 This function is no longer marked as "private".
 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default empty string.
 * @param string $message     Optional. A message regarding the change. Default empty string.
 */
function _deprecated_file($file, $version, $replacement = '', $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if ($replacement) {
                $message = sprintf(
                    /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'),
                    $file,
                    $version,
                    $replacement
                ) . $message;
            } else {
                $message = sprintf(
                    /* translators: 1: PHP file name, 2: Version number. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'),
                    $file,
                    $version
                ) . $message;
            }
        } else if ($replacement) {
            $message = sprintf('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement);
        } else {
            $message = sprintf('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message;
        }
        wp_trigger_error('', $message, E_USER_DEPRECATED);
    }
}

WordPress Version: 6.2

/**
 * Marks a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @since 5.4.0 This function is no longer marked as "private".
 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default empty string.
 * @param string $message     Optional. A message regarding the change. Default empty string.
 */
function _deprecated_file($file, $version, $replacement = '', $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if ($replacement) {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'),
                    $file,
                    $version,
                    $replacement
                ) . $message, E_USER_DEPRECATED);
            } else {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'),
                    $file,
                    $version
                ) . $message, E_USER_DEPRECATED);
            }
        } else if ($replacement) {
            trigger_error(sprintf('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message, E_USER_DEPRECATED);
        } else {
            trigger_error(sprintf('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message, E_USER_DEPRECATED);
        }
    }
}

WordPress Version: 6.1

/**
 * Marks a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @since 5.4.0 This function is no longer marked as "private".
 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default empty.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = '', $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if ($replacement) {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'),
                    $file,
                    $version,
                    $replacement
                ) . $message, E_USER_DEPRECATED);
            } else {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number. */
                    __('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'),
                    $file,
                    $version
                ) . $message, E_USER_DEPRECATED);
            }
        } else if ($replacement) {
            trigger_error(sprintf('File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message, E_USER_DEPRECATED);
        } else {
            trigger_error(sprintf('File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message, E_USER_DEPRECATED);
        }
    }
}

WordPress Version: 5.5

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @since 5.4.0 This function is no longer marked as "private".
 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default empty.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = '', $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if ($replacement) {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                    __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'),
                    $file,
                    $version,
                    $replacement
                ) . $message, E_USER_DEPRECATED);
            } else {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number. */
                    __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'),
                    $file,
                    $version
                ) . $message, E_USER_DEPRECATED);
            }
        } else if ($replacement) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message, E_USER_DEPRECATED);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message, E_USER_DEPRECATED);
        }
    }
}

WordPress Version: 5.4

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @since 5.4.0 This function is no longer marked as "private".
 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default null.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                    __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'),
                    $file,
                    $version,
                    $replacement
                ) . $message, E_USER_DEPRECATED);
            } else {
                trigger_error(sprintf(
                    /* translators: 1: PHP file name, 2: Version number. */
                    __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'),
                    $file,
                    $version
                ) . $message, E_USER_DEPRECATED);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message, E_USER_DEPRECATED);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message, E_USER_DEPRECATED);
        }
    }
}

WordPress Version: 5.3

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @access private
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default null.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                /* translators: 1: PHP file name, 2: Version number. */
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}

WordPress Version: 4.7

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @access private
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default null.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                /* translators: 1: PHP file name, 2: version number, 3: alternative file name */
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                /* translators: 1: PHP file name, 2: version number */
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}

WordPress Version: 4.6

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @access private
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default null.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filters whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}

WordPress Version: 4.0

/**
 * Mark a file as deprecated and inform when it has been used.
 *
 * There is a hook deprecated_file_included that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if WP_DEBUG is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @access private
 *
 * @param string $file        The file that was included.
 * @param string $version     The version of WordPress that deprecated the file.
 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
 *                            Default null.
 * @param string $message     Optional. A message regarding the change. Default empty.
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filter whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}

WordPress Version: 3.9

/**
 * Marks a file as deprecated and informs when it has been used.
 *
 * There is a hook deprecated_file_included that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if WP_DEBUG is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @since 2.5.0
 * @access private
 *
 * @param string $file The file that was included
 * @param string $version The version of WordPress that deprecated the file
 * @param string $replacement Optional. The file that should have been included based on ABSPATH
 * @param string $message Optional. A message regarding the change
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    /**
     * Fires when a deprecated file is called.
     *
     * @since 2.5.0
     *
     * @param string $file        The file that was called.
     * @param string $replacement The file that should have been included based on ABSPATH.
     * @param string $version     The version of WordPress that deprecated the file.
     * @param string $message     A message regarding the change.
     */
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    /**
     * Filter whether to trigger an error for deprecated files.
     *
     * @since 2.5.0
     *
     * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
     */
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}

WordPress Version: 3.7

/**
 * Marks a file as deprecated and informs when it has been used.
 *
 * There is a hook deprecated_file_included that will be called that can be used
 * to get the backtrace up to what file and function included the deprecated
 * file.
 *
 * The current behavior is to trigger a user error if WP_DEBUG is true.
 *
 * This function is to be used in every file that is deprecated.
 *
 * @package WordPress
 * @subpackage Debug
 * @since 2.5.0
 * @access private
 *
 * @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead,
 *   the version in which the file was deprecated, and any message regarding the change.
 * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do
 *   trigger or false to not trigger error.
 *
 * @param string $file The file that was included
 * @param string $version The version of WordPress that deprecated the file
 * @param string $replacement Optional. The file that should have been included based on ABSPATH
 * @param string $message Optional. A message regarding the change
 */
function _deprecated_file($file, $version, $replacement = null, $message = '')
{
    do_action('deprecated_file_included', $file, $replacement, $version, $message);
    // Allow plugin to filter the output error trigger
    if (WP_DEBUG && apply_filters('deprecated_file_trigger_error', true)) {
        $message = empty($message) ? '' : (' ' . $message);
        if (function_exists('__')) {
            if (!is_null($replacement)) {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement) . $message);
            } else {
                trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version) . $message);
            }
        } else if (!is_null($replacement)) {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement) . $message);
        } else {
            trigger_error(sprintf('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version) . $message);
        }
    }
}