Determines whether the value is an acceptable type for GD image functions.
Description
In PHP 8.0, the GD extension uses GdImage objects for its data structures.
This function checks if the passed value is either a GdImage object instance or a resource of type gd
. Any other type will return false.
Parameters
$image
resource|GdImage|falserequired- A value to check the type for.
Source
if ( ! empty( $attachment->post_mime_type ) ) {
$objects[] = 'attachment:' . $attachment->post_mime_type;
if ( str_contains( $attachment->post_mime_type, '/' ) ) {
foreach ( explode( '/', $attachment->post_mime_type ) as $token ) {
if ( ! empty( $token ) ) {
$objects[] = "attachment:$token";
}
Changelog
Version | Description |
---|---|
5.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.