summaryrefslogtreecommitdiffstats
path: root/wp-includes/customize
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/customize
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-includes/customize/class-wp-customize-media-control.php6
-rw-r--r--wp-includes/customize/class-wp-customize-nav-menu-item-control.php9
-rw-r--r--wp-includes/customize/class-wp-customize-nav-menu-location-control.php2
-rw-r--r--wp-includes/customize/class-wp-customize-site-icon-control.php40
4 files changed, 49 insertions, 8 deletions
diff --git a/wp-includes/customize/class-wp-customize-media-control.php b/wp-includes/customize/class-wp-customize-media-control.php
index f636892..c4af7c2 100644
--- a/wp-includes/customize/class-wp-customize-media-control.php
+++ b/wp-includes/customize/class-wp-customize-media-control.php
@@ -93,13 +93,13 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
* 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', 'webp' ), true ) ? 'image' : 'document';
+ $type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp', 'avif' ), true ) ? 'image' : 'document';
$default_attachment = array(
'id' => 1,
'url' => $this->setting->default,
'type' => $type,
- 'icon' => wp_mime_type_icon( $type ),
+ 'icon' => wp_mime_type_icon( $type, '.svg' ),
'title' => wp_basename( $this->setting->default ),
);
@@ -245,7 +245,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
case 'image':
return array(
'select' => __( 'Select image' ),
- 'site_icon' => __( 'Select site icon' ),
+ 'site_icon' => __( 'Select Site Icon' ),
'change' => __( 'Change image' ),
'default' => __( 'Default' ),
'remove' => __( 'Remove' ),
diff --git a/wp-includes/customize/class-wp-customize-nav-menu-item-control.php b/wp-includes/customize/class-wp-customize-nav-menu-item-control.php
index d6cae27..8915824 100644
--- a/wp-includes/customize/class-wp-customize-nav-menu-item-control.php
+++ b/wp-includes/customize/class-wp-customize-nav-menu-item-control.php
@@ -69,18 +69,23 @@ class WP_Customize_Nav_Menu_Item_Control extends WP_Customize_Control {
<span class="item-title" aria-hidden="true">
<span class="spinner"></span>
<span class="menu-item-title<# if ( ! data.title && ! data.original_title ) { #> no-title<# } #>">{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}</span>
+ <# if ( 0 === data.depth ) { #>
+ <span class="is-submenu" style="display: none;"><?php _e( 'sub item' ); ?></span>
+ <# } else { #>
+ <span class="is-submenu"><?php _e( 'sub item' ); ?></span>
+ <# } #>
</span>
<span class="item-controls">
<button type="button" class="button-link item-edit" aria-expanded="false"><span class="screen-reader-text">
<?php
/* translators: 1: Title of a menu item, 2: Type of a menu item. */
- printf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );
+ printf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );
?>
</span><span class="toggle-indicator" aria-hidden="true"></span></button>
<button type="button" class="button-link item-delete submitdelete deletion"><span class="screen-reader-text">
<?php
/* translators: 1: Title of a menu item, 2: Type of a menu item. */
- printf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );
+ printf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );
?>
</span></button>
</span>
diff --git a/wp-includes/customize/class-wp-customize-nav-menu-location-control.php b/wp-includes/customize/class-wp-customize-nav-menu-location-control.php
index 4877ada..b0340b1 100644
--- a/wp-includes/customize/class-wp-customize-nav-menu-location-control.php
+++ b/wp-includes/customize/class-wp-customize-nav-menu-location-control.php
@@ -77,7 +77,7 @@ class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {
<select <?php $this->link(); ?>>
<?php
foreach ( $this->choices as $value => $label ) :
- echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';
+ echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . esc_html( $label ) . '</option>';
endforeach;
?>
</select>
diff --git a/wp-includes/customize/class-wp-customize-site-icon-control.php b/wp-includes/customize/class-wp-customize-site-icon-control.php
index 942000a..33694b2 100644
--- a/wp-includes/customize/class-wp-customize-site-icon-control.php
+++ b/wp-includes/customize/class-wp-customize-site-icon-control.php
@@ -66,11 +66,47 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
<img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" alt="" />
<div class="favicon">
- <img src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" />
+ <img src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="{{
+ data.attachment.alt ?
+ wp.i18n.sprintf(
+ <?php
+ /* translators: %s: The selected image alt text. */
+ echo wp_json_encode( __( 'Browser icon preview: Current image: %s' ) );
+ ?>
+ ,
+ data.attachment.alt
+ ) :
+ wp.i18n.sprintf(
+ <?php
+ /* translators: %s: The selected image filename. */
+ echo wp_json_encode( __( 'Browser icon preview: The current image has no alternative text. The file name is: %s' ) );
+ ?>
+ ,
+ data.attachment.filename
+ )
+ }}" />
</div>
<span class="browser-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></span>
</div>
- <img class="app-icon-preview" src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" />
+ <img class="app-icon-preview" src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="{{
+ data.attachment.alt ?
+ wp.i18n.sprintf(
+ <?php
+ /* translators: %s: The selected image alt text. */
+ echo wp_json_encode( __( 'App icon preview: Current image: %s' ) )
+ ?>
+ ,
+ data.attachment.alt
+ ) :
+ wp.i18n.sprintf(
+ <?php
+ /* translators: %s: The selected image filename. */
+ echo wp_json_encode( __( 'App icon preview: The current image has no alternative text. The file name is: %s' ) );
+ ?>
+ ,
+ data.attachment.filename
+ )
+ }}"/>
</div>
<# } #>
<div class="actions">