Last active
October 7, 2021 14:02
-
-
Save itsHall/135fac655ee91f3e83cf818d71b13c48 to your computer and use it in GitHub Desktop.
Allow Upload of WebP to WordPress Media Gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function webp_upload_mimes( $existing_mimes ) { | |
// add webp to the list of mime types | |
$existing_mimes['webp'] = 'image/webp'; | |
// return the array back to the function with our added mime type | |
return $existing_mimes; | |
} | |
add_filter( 'mime_types', 'webp_upload_mimes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment