rest_handle_deprecated_argument() - WordPress 函数参考中文文档

返回介绍

rest_handle_deprecated_argument()

发布于 2017-09-11 字数1616 浏览 1020 评论 0

rest_handle_deprecated_argument( string $function,  string $message,  string $version )

Handles _deprecated_argument() errors.


描述


参数

$function

(string)
(Required)
The function that was called.

$message

(string)
(Required)
A message regarding the change.

$version

(string)
(Required)
Version.


源代码

File: wp-includes/rest-api.php

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

更新日志

Version 描述
4.4.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!