Skip to content

Instantly share code, notes, and snippets.

@mymizan
Last active February 22, 2022 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mymizan/6172de7a5ef3281e8100616d8ac785c8 to your computer and use it in GitHub Desktop.
Save mymizan/6172de7a5ef3281e8100616d8ac785c8 to your computer and use it in GitHub Desktop.
Allow uploading of webp image by media media_sideload_image()
<?php
/**
* Allow webp for media_sideload function.
*/
add_filter( 'image_sideload_extensions', 'woonet_add_types', 10, 1 );
function woonet_add_types( $ext ) {
$ext[] = 'webp';
return $ext;
}
@sagive
Copy link

sagive commented Feb 21, 2022

10x Yakub... did similarly but for some reason, mine didn't work. 👍🙏

@mymizan
Copy link
Author

mymizan commented Feb 22, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment