is_wp_error( mixed $thing )

Check whether variable is a WordPress Error.

Description Description

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

Parameters Parameters


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

Top ↑

Return Return

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

Top ↑

Source Source

File: wp-includes/load.php

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

Top ↑

Changelog Changelog

Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.