Changeset 57713 for trunk/src/wp-admin/options-general.php
- Timestamp:
- 02/26/2024 08:16:09 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-general.php
r57618 r57713 108 108 $classes_for_upload_button = 'upload-button button-add-media button-add-site-icon'; 109 109 $classes_for_update_button = 'button'; 110 111 $classes_for_avatar = 'avatar avatar-150'; 110 $classes_for_wrapper = ''; 111 112 112 if ( has_site_icon() ) { 113 $classes_for_ avatar.= ' has-site-icon';113 $classes_for_wrapper .= ' has-site-icon'; 114 114 $classes_for_button = $classes_for_update_button; 115 115 $classes_for_button_on_change = $classes_for_upload_button; 116 116 } else { 117 $classes_for_ avatar.= ' hidden';117 $classes_for_wrapper .= ' hidden'; 118 118 $classes_for_button = $classes_for_upload_button; 119 119 $classes_for_button_on_change = $classes_for_update_button; 120 120 } 121 121 122 123 ?> 124 <div id="site-icon-preview" class="site-icon-preview wp-clearfix <?php echo esc_attr( $classes_for_avatar ); ?>"> 122 // Handle alt text for site icon on page load. 123 $site_icon_id = (int) get_option( 'site_icon' ); 124 $app_icon_alt_value = ''; 125 $browser_icon_alt_value = ''; 126 127 if ( $site_icon_id ) { 128 $img_alt = get_post_meta( $site_icon_id, '_wp_attachment_image_alt', true ); 129 $filename = wp_basename( get_site_icon_url() ); 130 $app_icon_alt_value = sprintf( 131 /* translators: %s: The selected image filename. */ 132 __( 'App icon preview: The current image has no alternative text. The file name is: %s' ), 133 $filename 134 ); 135 136 $browser_icon_alt_value = sprintf( 137 /* translators: %s: The selected image filename. */ 138 __( 'Browser icon preview: The current image has no alternative text. The file name is: %s' ), 139 $filename 140 ); 141 142 if ( $img_alt ) { 143 $app_icon_alt_value = sprintf( 144 /* translators: %s: The selected image alt text. */ 145 __( 'App icon preview: Current image: %s' ), 146 $img_alt 147 ); 148 149 $browser_icon_alt_value = sprintf( 150 /* translators: %s: The selected image alt text. */ 151 __( 'Browser icon preview: Current image: %s' ), 152 $img_alt 153 ); 154 } 155 } 156 ?> 157 158 159 <div id="site-icon-preview" class="site-icon-preview wp-clearfix settings-page-preview <?php echo esc_attr( $classes_for_wrapper ); ?>"> 125 160 <div class="favicon-preview"> 126 161 <img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" alt=""> 127 162 <div class="favicon"> 128 <img src="<?php site_icon_url(); ?>" alt="<?php esc_attr_e( 'Preview as a browser icon'); ?>">163 <img id="browser-icon-preview" src="<?php site_icon_url(); ?>" alt="<?php echo esc_attr( $browser_icon_alt_value ); ?>"> 129 164 </div> 130 <span class="browser-title" aria-hidden="true"><?php echo get_bloginfo( 'name' ); ?></span>165 <span id="site-icon-preview-site-title" class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span> 131 166 </div> 132 <img class="app-icon-preview" src="<?php site_icon_url(); ?>" alt="<?php esc_attr_e( 'Preview as an app icon'); ?>">167 <img id="app-icon-preview" class="app-icon-preview" src="<?php site_icon_url(); ?>" alt="<?php echo esc_attr( $app_icon_alt_value ); ?>"> 133 168 </div> 169 134 170 <input type="hidden" name="site_icon" id="site_icon_hidden_field" value="<?php form_option( 'site_icon' ); ?>" /> 135 171 <div class="action-buttons"> 136 172 <button type="button" 137 id="choose-from-library- link"173 id="choose-from-library-button" 138 174 type="button" 139 175 class="<?php echo esc_attr( $classes_for_button ); ?>" … … 162 198 163 199 <p class="description"> 164 <?php _e( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. Upload one here!' ); ?>165 </p>166 <p class="description">167 200 <?php 168 201 /* translators: %s: Site Icon size in pixels. */ 169 printf( __( 'Site Icons should be square and at least %s pixels.' ), '<strong>512 × 512</strong>' );202 printf( __( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. They should be square and at least %s pixels.' ), '<code>512 × 512</code>' ); 170 203 ?> 171 204 </p>
Note: See TracChangeset
for help on using the changeset viewer.