diff --git a/includes/utils.php b/includes/utils.php index 3579a8d67..4c2bc30e7 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -905,7 +905,21 @@ function process_media( $url, $post_id, $args = [] ) { * * @return {array} Media extensions to be processed. */ - $allowed_extensions = apply_filters( 'dt_allowed_media_extensions', array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ), $url, $post_id ); + $allowed_extensions = apply_filters( + 'dt_allowed_media_extensions', + array( + 'jpg', + 'jpeg', + 'jpe', + 'gif', + 'png', + 'webp', + 'heic', + 'avif', + ), + $url, + $post_id + ); preg_match( '/[^\?]+\.(' . implode( '|', $allowed_extensions ) . ')\b/i', $url, $matches ); if ( ! $matches ) { $media_name = null; diff --git a/tests/php/includes/common.php b/tests/php/includes/common.php index d7ba845c9..e8c2a1645 100644 --- a/tests/php/includes/common.php +++ b/tests/php/includes/common.php @@ -266,6 +266,9 @@ function get_allowed_mime_types() { 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon', + 'webp' => 'image/webp', + 'heic' => 'image/heic', + 'avif' => 'image/avif', ]; }