tomjn / WordPress-The-Right-Way

WordPress The Right Way
https://www.wptherightway.org
Other
314 stars 61 forks source link

Handling Errors / is_wp_error #49

Closed kraftner closed 9 years ago

kraftner commented 9 years ago

At http://www.wptherightway.org/en/debugging/handlingerrors.html it says

is_wp_error

This is a helpful method to simplify error checking. It checks if a returned value was a WP_Error >object, and also checks for a handful of other error values.

Looking at the source It seems that there are no other checks than for WP_Error.

Anything I missed or should this part of the sentence just be removed?

tomjn commented 9 years ago

I don't think the bolded text should be removed, instead it should be replaced to state clearly it does not check for other values. Perhaps:

This is a helpful method to simplify error checking. It checks if a returned value was a WP_Error >object, but does not check for other error values. It's shorthand for if ( get_class( $variable ) == 'WP_Error' )

kraftner commented 9 years ago

Even better.