Created
May 21, 2021 17:22
-
-
Save adamsilverstein/9cf8ba4ebc3838031fc27b45ff20e014 to your computer and use it in GitHub Desktop.
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 | |
// Ensure all network sites include WebP support. | |
add_filter( | |
'site_option_upload_filetypes', | |
function ( $filetypes ) { | |
$filetypes = explode( ' ', $filetypes ); | |
if ( ! in_array( 'webp', $filetypes, true ) ) { | |
$filetypes[] = 'webp'; | |
$filetypes = implode( ' ', $filetypes ); | |
} | |
return $filetypes; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment