Changeset 49022 for trunk/src/wp-includes/load.php
- Timestamp:
- 09/20/2020 05:43:00 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r48941 r49022 1447 1447 1448 1448 /** 1449 * Check whethervariable is a WordPress Error.1450 * 1451 * Returns true if $thing is an object of the WP_Errorclass.1449 * Checks whether the given variable is a WordPress Error. 1450 * 1451 * Returns whether `$thing` is an instance of the `WP_Error` class. 1452 1452 * 1453 1453 * @since 2.1.0 1454 1454 * 1455 * @param mixed $thing Check if unknown variable is a WP_Error object.1456 * @return bool True, if WP_Error. False, if notWP_Error.1455 * @param mixed $thing The variable to check. 1456 * @return bool Whether the variable is an instance of WP_Error. 1457 1457 */ 1458 1458 function is_wp_error( $thing ) { 1459 return ( $thing instanceof WP_Error ); 1459 $is = ( $thing instanceof WP_Error ); 1460 1461 if ( $is ) { 1462 /** 1463 * Fires when `is_wp_error()` is called and it's an instance of `WP_Error`. 1464 * 1465 * @since 5.6.0 1466 * 1467 * @param WP_Error $thing The error object passed to `is_wp_error()`. 1468 */ 1469 do_action( 'wp_error_checked', $thing ); 1470 } 1471 1472 return $is; 1460 1473 } 1461 1474
Note: See TracChangeset
for help on using the changeset viewer.