is_wp_error
函数
      is_wp_error ( $thing )    
  - 参数
 - 
- 
                (mixed)
$thing
The variable to check.- Required: 是
 
 
 - 
                (mixed)
 
- 返回值
 - 
- (bool) Whether the variable is an instance of WP_Error.
 
 
- 定义位置
 - 
- 
                                  wp-includes/load.php
, line 1588 
 - 
                                  wp-includes/load.php
 
- 引入
 - 2.1.0
 
- 弃用
 - –
 
Checks whether the given variable is a WordPress Error.
Returns whether `$thing` is an instance of the `WP_Error` class.
function is_wp_error( $thing ) {
	$is_wp_error = ( $thing instanceof WP_Error );
	if ( $is_wp_error ) {
		/**
		 * Fires when `is_wp_error()` is called and its parameter is an instance of `WP_Error`.
		 *
		 * @since 5.6.0
		 *
		 * @param WP_Error $thing The error object passed to `is_wp_error()`.
		 */
		do_action( 'is_wp_error_instance', $thing );
	}
	return $is_wp_error;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。