WordPress开发者和主题制作者的搜索引擎



is_wp_error ›

Since2.1.0
已弃用n/a
is_wp_error ( $thing )
参数:
  • (mixed) $thing Check if unknown variable is a WP_Error object.
    Required: Yes
返回:
  • (bool) True, if WP_Error. False, if not WP_Error.
定义在:
文档:

Check whether variable is a WordPress Error.

Returns true if $thing is an object of the WP_Error class.



源码

function is_wp_error( $thing ) {
	return ( $thing instanceof WP_Error );
}