diff --git src/wp-includes/class-wp-image-editor-gd.php src/wp-includes/class-wp-image-editor-gd.php
index de079357fb..43eacd3a4c 100644
|
|
|
class WP_Image_Editor_GD extends WP_Image_Editor { |
| 71 | 71 | return ( $image_types & IMG_GIF ) != 0; |
| 72 | 72 | case 'image/webp': |
| 73 | 73 | return ( $image_types & IMG_WEBP ) != 0; |
| | 74 | case 'image/avif': |
| | 75 | return ( $image_types & IMG_AVIF ) != 0; |
| 74 | 76 | } |
| 75 | 77 | |
| 76 | 78 | return false; |
diff --git src/wp-includes/compat.php src/wp-includes/compat.php
index 5bfdbc23d6..3c8e911a3d 100644
|
|
|
if ( ! defined( 'IMAGETYPE_WEBP' ) ) { |
| 497 | 497 | if ( ! defined( 'IMG_WEBP' ) ) { |
| 498 | 498 | define( 'IMG_WEBP', IMAGETYPE_WEBP ); |
| 499 | 499 | } |
| | 500 | |
| | 501 | // IMAGETYPE_AVIF constant is only defined in PHP 8.x or later. |
| | 502 | if ( ! defined( 'IMAGETYPE_AVIF' ) ) { |
| | 503 | define( 'IMAGETYPE_AVIF', 19 ); |
| | 504 | } |
| | 505 | |
| | 506 | // IMG_AVIF constant is only defined in PHP 8.x or later. |
| | 507 | if ( ! defined( 'IMG_AVIF' ) ) { |
| | 508 | define( 'IMG_AVIF', IMAGETYPE_AVIF ); |
| | 509 | } |