is_wp_error( mixed $thing )

Check whether variable is a ClassicPress Error.


Description

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


Parameters

$thing

(mixed) (Required) Check if unknown variable is a WP_Error object.


Return

(bool) True, if WP_Error. False, if not WP_Error.


Source

File: wp-includes/load.php

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


Changelog

Changelog
Version Description
WP-2.1.0 Introduced.