X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-includes/class-wp-error.php?ds=sidebyside diff --git a/wp-includes/class-wp-error.php b/wp-includes/class-wp-error.php index c1b07ab6..22273f89 100644 --- a/wp-includes/class-wp-error.php +++ b/wp-includes/class-wp-error.php @@ -11,8 +11,8 @@ * WordPress Error class. * * Container for checking for WordPress errors and error messages. Return - * WP_Error and use {@link is_wp_error()} to check if this class is returned. - * Many core WordPress functions pass this class in the event of an error and + * WP_Error and use is_wp_error() to check if this class is returned. Many + * core WordPress functions pass this class in the event of an error and * if not handled properly will result in code errors. * * @package WordPress @@ -144,7 +144,7 @@ class WP_Error { * @since 2.1.0 * * @param string|int $code Optional. Error code. - * @return mixed Null, if no errors. + * @return mixed Error data, if it exists. */ public function get_error_data($code = '') { if ( empty($code) ) @@ -152,7 +152,6 @@ class WP_Error { if ( isset($this->error_data[$code]) ) return $this->error_data[$code]; - return null; } /** @@ -203,17 +202,3 @@ class WP_Error { unset( $this->error_data[ $code ] ); } } - -/** - * Check whether variable is a WordPress Error. - * - * Returns true if $thing is an object of the WP_Error class. - * - * @since 2.1.0 - * - * @param mixed $thing Check if unknown variable is a WP_Error object. - * @return bool True, if WP_Error. False, if not WP_Error. - */ -function is_wp_error( $thing ) { - return ( $thing instanceof WP_Error ); -}