rest_handle_deprecated_argument

函数


rest_handle_deprecated_argument ( $function, $message, $version )
参数
  • (string)
    $function
    The function that was called.
    Required:
  • (string)
    $message
    A message regarding the change.
    Required:
  • (string)
    $version
    Version.
    Required:
定义位置
  • wp-includes/rest-api.php
    , line 673
引入
4.4.0
弃用

Handles _deprecated_argument() errors.

function rest_handle_deprecated_argument( $function, $message, $version ) {
	if ( ! WP_DEBUG || headers_sent() ) {
		return;
	}
	if ( $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 ) );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。