Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
_deprecated_argument() - 将函数参数标记为已弃用,并在使用时通知 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / _deprecated_argument()

_deprecated_argument( string $function, string $version, string $message = '' )

将函数参数标记为已弃用,并在使用时通知


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "aa8aab959e4c242a95031c747073d93e" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "ce4cef636bef929dc0acc8784074e859" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "0ad1a665e15a8b1e601814716a0cf6c3" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "2a5a32ea92980b6f7c1956c8b033f304" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

previous 上一...


描述

每当使用不推荐使用的函数参数时,都将使用此函数。在调用此函数之前,必须通过将参数与其默认值进行比较或评估参数是否为空来检查参数是否已被使用。例如:

if ( ! empty( $deprecated ) ) {
    _deprecated_argument( __FUNCTION__, '3.0.0' );
}

将调用一个钩子deprecated_argument_run,该钩子可用于回溯到使用不推荐的参数的文件和函数。

如果WP_DEBUG为真,则当前行为将触发用户错误。


参数

$function

(string)(必填) 调用的函数。

$version

(string)(必填) 不推荐使用的参数的WordPress版本。

$message

(string)(可选) 关于更改的消息。

默认值: ''



源码

查看源码 官方文档


更新日志

版本描述
5.4.0错误类型现在分类为E_USER_DEPRECATED(用于默认为E_USER_NOTICE)
3.0.0开始引入

Warning: Undefined variable $o in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference.php on line 194