wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
gd_edit_image_support is deprecated since version 3.5.0!
Alternative: wp_image_editor_supports()
Alternative: wp_image_editor_supports()
gd_edit_image_support › WordPress Function
Seit2.9.0
Veraltet3.5.0
› gd_edit_image_support ( $mime_type )
Parameter: |
|
Siehe: | |
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Check if the installed version of GD supports particular image type
Ähnliche Funktionen: get_theme_support, add_theme_support, get_image_tag, _add_default_theme_supports, wp_image_editor_supports
Quellcode
function gd_edit_image_support($mime_type) { _deprecated_function( __FUNCTION__, '3.5.0', 'wp_image_editor_supports()' ); if ( function_exists('imagetypes') ) { switch( $mime_type ) { case 'image/jpeg': return (imagetypes() & IMG_JPG) != 0; case 'image/png': return (imagetypes() & IMG_PNG) != 0; case 'image/gif': return (imagetypes() & IMG_GIF) != 0; case 'image/webp': return (imagetypes() & IMG_WEBP) != 0; case 'image/avif': return (imagetypes() & IMG_AVIF) != 0; } } else { switch( $mime_type ) { case 'image/jpeg': return function_exists('imagecreatefromjpeg'); case 'image/png': return function_exists('imagecreatefrompng'); case 'image/gif': return function_exists('imagecreatefromgif'); case 'image/webp': return function_exists('imagecreatefromwebp'); case 'image/avif': return function_exists('imagecreatefromavif'); } } return false; }