diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index f089fc8201..e719b63428 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -912,29 +912,6 @@ function file_is_displayable_image( $path ) { return apply_filters( 'file_is_displayable_image', $result, $path ); } -/** - * Determines whether the value is an acceptable type for GD image functions. - * - * In PHP 8.0, the GD extension uses GdImage objects for its data structures. - * This function checks if the passed value is either a resource of type `gd` - * or a GdImage object instance. Any other type will return false. - * - * @since 5.6.0 - * - * @param resource|GdImage|false $image A value to check the type for. - * @return bool True if $image is either a GD image resource or GdImage instance, - * false otherwise. - */ -function is_gd_image( $image ) { - if ( is_resource( $image ) && 'gd' === get_resource_type( $image ) - || is_object( $image ) && $image instanceof GdImage - ) { - return true; - } - - return false; -} - /** * Load an image resource for editing. * diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 2a9307ae65..e1091b9d8e 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -3458,6 +3458,29 @@ function get_taxonomies_for_attachments( $output = 'names' ) { return $taxonomies; } +/** + * Determines whether the value is an acceptable type for GD image functions. + * + * In PHP 8.0, the GD extension uses GdImage objects for its data structures. + * This function checks if the passed value is either a resource of type `gd` + * or a GdImage object instance. Any other type will return false. + * + * @since 5.6.0 + * + * @param resource|GdImage|false $image A value to check the type for. + * @return bool True if $image is either a GD image resource or GdImage instance, + * false otherwise. + */ +function is_gd_image( $image ) { + if ( is_resource( $image ) && 'gd' === get_resource_type( $image ) + || is_object( $image ) && $image instanceof GdImage + ) { + return true; + } + + return false; +} + /** * Create new GD image resource with transparency support *