--- a/wp/wp-includes/widgets/class-wp-widget-media-video.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/widgets/class-wp-widget-media-video.php Fri Sep 05 18:40:08 2025 +0200
@@ -228,17 +228,35 @@
?>
<script type="text/html" id="tmpl-wp-media-widget-video-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 && 'unsupported_file_type' === data.error ) { #>
- <div class="notice notice-error notice-alt notice-missing-attachment">
- <p><?php echo $this->l10n['unsupported_file_type']; ?></p>
- </div>
+ <?php
+ wp_admin_notice(
+ $this->l10n['unsupported_file_type'],
+ 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.is_oembed && data.model.poster ) { #>
<a href="{{ data.model.src }}" target="_blank" class="media-widget-video-link">
<img src="{{ data.model.poster }}" />