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