Changeset 48905 for trunk/src/wp-includes/media.php
- Timestamp:
- 08/28/2020 04:43:31 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r48855 r48905 3460 3460 3461 3461 /** 3462 * Determines whether the value is an acceptable type for GD image functions. 3463 * 3464 * In PHP 8.0, the GD extension uses GdImage objects for its data structures. 3465 * This function checks if the passed value is either a resource of type `gd` 3466 * or a GdImage object instance. Any other type will return false. 3467 * 3468 * @since 5.6.0 3469 * 3470 * @param resource|GdImage|false $image A value to check the type for. 3471 * @return bool True if $image is either a GD image resource or GdImage instance, 3472 * false otherwise. 3473 */ 3474 function is_gd_image( $image ) { 3475 if ( is_resource( $image ) && 'gd' === get_resource_type( $image ) 3476 || is_object( $image ) && $image instanceof GdImage 3477 ) { 3478 return true; 3479 } 3480 3481 return false; 3482 } 3483 3484 /** 3462 3485 * Create new GD image resource with transparency support 3463 3486 *
Note: See TracChangeset
for help on using the changeset viewer.