--- a/wp/wp-includes/widgets/class-wp-widget-media-audio.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/widgets/class-wp-widget-media-audio.php Fri Sep 05 18:40:08 2025 +0200
@@ -189,13 +189,25 @@
?>
<script type="text/html" id="tmpl-wp-media-widget-audio-preview">
<# if ( data.error && 'missing_attachment' === data.error ) { #>
- <div class="notice notice-error notice-alt notice-missing-attachment">
- <p><?php echo $this->l10n['missing_attachment']; ?></p>
- </div>
+ <?php
+ wp_admin_notice(
+ $this->l10n['missing_attachment'],
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'notice-alt', 'notice-missing-attachment' ),
+ )
+ );
+ ?>
<# } else if ( data.error ) { #>
- <div class="notice notice-error notice-alt">
- <p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p>
- </div>
+ <?php
+ wp_admin_notice(
+ __( 'Unable to preview media due to an unknown error.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'notice-alt' ),
+ )
+ );
+ ?>
<# } else if ( data.model && data.model.src ) { #>
<?php wp_underscore_audio_template(); ?>
<# } #>