rest_handle_doing_it_wrong
函数
rest_handle_doing_it_wrong ( $function, $message, $version )
- 参数
-
-
(string)
$function
The function that was called.- Required: 是
-
(string)
$message
A message explaining what has been done incorrectly.- Required: 是
-
(string|null)
$version
The version of WordPress where the message was added.- Required: 是
-
(string)
- 定义位置
-
-
wp-includes/rest-api.php
, line 697
-
wp-includes/rest-api.php
- 引入
- 5.5.0
- 弃用
- –
Handles _doing_it_wrong errors.
function rest_handle_doing_it_wrong( $function, $message, $version ) {
if ( ! WP_DEBUG || headers_sent() ) {
return;
}
if ( $version ) {
/* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */
$string = __( '%1$s (since %2$s; %3$s)' );
$string = sprintf( $string, $function, $version, $message );
} else {
/* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */
$string = __( '%1$s (%2$s)' );
$string = sprintf( $string, $function, $message );
}
header( sprintf( 'X-WP-DoingItWrong: %s', $string ) );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。