wp/wp-includes/customize/class-wp-customize-media-control.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-includes/customize/class-wp-customize-media-control.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/customize/class-wp-customize-media-control.php	Wed Sep 21 18:19:35 2022 +0200
@@ -91,7 +91,7 @@
 				// Fake an attachment model - needs all fields used by template.
 				// Note that the default value must be a URL, NOT an attachment ID.
 				$ext  = substr( $this->setting->default, -3 );
-				$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp' ), true ) ? 'image' : 'document';
+				$type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp' ), true ) ? 'image' : 'document';
 
 				$default_attachment = array(
 					'id'    => 1,
@@ -170,13 +170,13 @@
 						<p class="attachment-meta">{{ data.attachment.artist || data.attachment.meta.artist }}</p>
 						<# } #>
 						<audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none">
-							<source type="{{ data.attachment.mime }}" src="{{ data.attachment.url }}"/>
+							<source type="{{ data.attachment.mime }}" src="{{ data.attachment.url }}" />
 						</audio>
 					<# } else if ( 'video' === data.attachment.type ) { #>
 						<div class="wp-media-wrapper wp-video">
 							<video controls="controls" class="wp-video-shortcode" preload="metadata"
 								<# if ( data.attachment.image && data.attachment.image.src !== data.attachment.icon ) { #>poster="{{ data.attachment.image.src }}"<# } #>>
-								<source type="{{ data.attachment.mime }}" src="{{ data.attachment.url }}"/>
+								<source type="{{ data.attachment.mime }}" src="{{ data.attachment.url }}" />
 							</video>
 						</div>
 					<# } else { #>