From 449407a538dd342c71f0572107a2c3f06e5ce31c Mon Sep 17 00:00:00 2001 From: unclelama <118566823+unclelama@users.noreply.github.com> Date: Sat, 19 Nov 2022 02:16:40 +0600 Subject: [PATCH] Update functions.php Need to add avif pictures to the storefront child theme --- custom/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom/functions.php b/custom/functions.php index a243fad..60304a5 100644 --- a/custom/functions.php +++ b/custom/functions.php @@ -15,3 +15,13 @@ * functions.php * Add PHP snippets here */ + function allow_modern_images( $mime_types ) { + $mime_types['heic'] = 'image/heic'; + $mime_types['heif'] = 'image/heif'; + $mime_types['heics'] = 'image/heic-sequence'; + $mime_types['heifs'] = 'image/heif-sequence'; + $mime_types['avif'] = 'image/avif'; + $mime_types['avifs'] = 'image/avif-sequence'; + return $mime_types; +} +add_filter( 'upload_mimes', 'allow_modern_images');