WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

_deprecated_file() WP 2.5.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.

Возвращает

Null. Ничего.

Использование

_deprecated_file( $file, $version, $replacement, $message );
$file(строка) (обязательный)
The file that was included.
$version(строка) (обязательный)
The version of WordPress that deprecated the file.
$replacement(строка)
The file that should have been included based on ABSPATH.
По умолчанию: ''
$message(строка)
A message regarding the change.
По умолчанию: ''

Список изменений

С версии 2.5.0 Введена.
С версии 5.4.0 This function is no longer marked as "private".
С версии 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).

Код _deprecated_file() WP 5.5.3

<?php
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
				);
			}
		}
	}
}