A WordPress-centric search engine for devs and theme authors



is_wp_error ›

Since2.1.0
Deprecatedn/a
is_wp_error ( $thing )
Parameters:
  • (mixed) $thing Check if unknown variable is a WP_Error object.
    Required: Yes
Returns:
  • (bool) True, if WP_Error. False, if not WP_Error.
Defined at:
Codex:

Check whether variable is a WordPress Error.

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



Source

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