Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -240,12 +240,11 @@ class WP_Widget_Media_Image extends WP_Widget_Media {
|
||||
}
|
||||
|
||||
$attr = array(
|
||||
'class' => $classes,
|
||||
'src' => $instance['url'],
|
||||
'alt' => $instance['alt'],
|
||||
'width' => $instance['width'],
|
||||
'height' => $instance['height'],
|
||||
'decoding' => 'async',
|
||||
'class' => $classes,
|
||||
'src' => $instance['url'],
|
||||
'alt' => $instance['alt'],
|
||||
'width' => $instance['width'],
|
||||
'height' => $instance['height'],
|
||||
);
|
||||
|
||||
$loading_optimization_attr = wp_get_loading_optimization_attributes(
|
||||
@@ -363,13 +362,25 @@ class WP_Widget_Media_Image extends WP_Widget_Media {
|
||||
</script>
|
||||
<script type="text/html" id="tmpl-wp-media-widget-image-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.url ) { #>
|
||||
<img class="attachment-thumb" src="{{ data.url }}" draggable="false" alt="{{ data.alt }}"
|
||||
<# if ( ! data.alt && data.currentFilename ) { #>
|
||||
|
||||
Reference in New Issue
Block a user