upload webp to wordpress

Solutions on MaxInterview for upload webp to wordpress by the best coders in the world

showing results for - "upload webp to wordpress"
Paula
04 Sep 2019
1// add this code into your function.php file in theme editor
2
3function webp_upload_mimes( $existing_mimes ) {
4	// add webp to the list of mime types
5	$existing_mimes['webp'] = 'image/webp';
6
7	// return the array back to the function with our added mime type
8	return $existing_mimes;
9}
10add_filter( 'mime_types', 'webp_upload_mimes' );
Dario
19 Sep 2016
1function webp_upload_mimes( $existing_mimes ) {
2	// add webp to the list of mime types
3	$existing_mimes['webp'] = 'image/webp';
4
5	// return the array back to the function with our added mime type
6	return $existing_mimes;
7}
8add_filter( 'mime_types', 'webp_upload_mimes' );