ネクストベータ代表Blog

WEBシステム SI屋の代表のブログです。

*

関数 _deprecated_file()

   

定義ファイル :/blog/wp-includes/functions.php 16
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* 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 );
}
}
}

 - 関数