Changeset 59400
- Timestamp:
- 11/13/2024 12:25:43 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r58879 r59400 584 584 $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] ); 585 585 ?> 586 <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>"><?php _e( 'Theme Details' ); ?></button> 586 <button type="button" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>" 587 aria-label="<?php echo esc_attr( $details_aria_label ); ?>" 588 ><?php _e( 'Theme Details' ); ?></button> 587 589 <div class="theme-author"> 588 590 <?php … … 608 610 $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] ); 609 611 ?> 610 <a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> 612 <a class="button button-primary customize load-customize hide-if-no-customize" 613 href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" 614 aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" 615 ><?php _e( 'Customize' ); ?></a> 611 616 <?php } ?> 612 617 <?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?> … … 615 620 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); 616 621 ?> 617 <a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 622 <a class="button activate" 623 href="<?php echo esc_url( $theme['actions']['activate'] ); ?>" 624 aria-label="<?php echo esc_attr( $aria_label ); ?>" 625 ><?php _e( 'Activate' ); ?></a> 626 618 627 <?php 619 628 // Only classic themes require the "customize" capability. … … 622 631 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 623 632 ?> 624 <a aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> 633 <a class="button button-primary load-customize hide-if-no-customize" 634 href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" 635 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 636 ><?php _e( 'Live Preview' ); ?></a> 625 637 <?php } ?> 626 638 <?php } else { ?> … … 629 641 $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); 630 642 ?> 631 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 632 <?php if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> 633 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 643 <a class="button disabled" 644 aria-label="<?php echo esc_attr( $aria_label ); ?>" 645 ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 646 647 <?php 648 if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 649 /* translators: %s: Theme name. */ 650 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 651 ?> 652 <a class="button button-primary hide-if-no-customize disabled" 653 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 654 ><?php _e( 'Live Preview' ); ?></a> 634 655 <?php } ?> 635 656 <?php } ?> … … 955 976 $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' ); 956 977 ?> 957 <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></button> 978 <button type="button" class="more-details" id="{{ data.id }}-action" 979 aria-label="<?php echo esc_attr( $details_aria_label ); ?>" 980 ><?php _e( 'Theme Details' ); ?></button> 958 981 <div class="theme-author"> 959 982 <?php … … 979 1002 $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' ); 980 1003 ?> 981 <a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a> 1004 <a class="button button-primary customize load-customize hide-if-no-customize" 1005 href="{{{ data.actions.customize }}}" 1006 aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" 1007 ><?php _e( 'Customize' ); ?></a> 982 1008 <# } #> 983 1009 <# } else { #> … … 987 1013 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); 988 1014 ?> 989 <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 1015 <a class="button activate" 1016 href="{{{ data.actions.activate }}}" 1017 aria-label="<?php echo esc_attr( $aria_label ); ?>" 1018 ><?php _e( 'Activate' ); ?></a> 1019 990 1020 <?php 991 1021 /* translators: %s: Theme name. */ 992 1022 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 993 1023 ?> 994 <a aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> 1024 <a class="button button-primary load-customize hide-if-no-customize" 1025 href="{{{ data.actions.customize }}}" 1026 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1027 ><?php _e( 'Live Preview' ); ?></a> 995 1028 <# } else { #> 996 1029 <?php … … 998 1031 $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); 999 1032 ?> 1000 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1033 <a class="button disabled" 1034 aria-label="<?php echo esc_attr( $aria_label ); ?>" 1035 ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1036 1001 1037 <# if ( ! data.blockTheme ) { #> 1002 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 1038 <?php 1039 /* translators: %s: Theme name. */ 1040 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1041 ?> 1042 <a class="button button-primary hide-if-no-customize disabled" 1043 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1044 ><?php _e( 'Live Preview' ); ?></a> 1003 1045 <# } #> 1004 1046 <# } #> … … 1212 1254 <div class="theme-actions"> 1213 1255 <div class="active-theme"> 1214 <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a> 1256 <a class="button button-primary customize load-customize hide-if-no-customize" 1257 href="{{{ data.actions.customize }}}" 1258 ><?php _e( 'Customize' ); ?></a> 1215 1259 <?php echo implode( ' ', $current_theme_actions ); ?> 1216 1260 </div> 1261 1217 1262 <div class="inactive-theme"> 1218 1263 <# if ( data.compatibleWP && data.compatiblePHP ) { #> 1219 <?php1220 /* translators: %s: Theme name. */1221 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );1222 ?>1223 1264 <# if ( ! data.blockTheme ) { #> 1224 <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> 1265 <?php 1266 /* translators: %s: Theme name. */ 1267 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1268 ?> 1269 <a class="button button-primary load-customize hide-if-no-customize" 1270 href="{{{ data.actions.customize }}}" 1271 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1272 ><?php _e( 'Live Preview' ); ?></a> 1225 1273 <# } #> 1274 1226 1275 <# if ( data.actions.activate ) { #> 1227 <a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 1276 <?php 1277 /* translators: %s: Theme name. */ 1278 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); 1279 ?> 1280 <a class="button activate" 1281 href="{{{ data.actions.activate }}}" 1282 aria-label="<?php echo esc_attr( $aria_label ); ?>" 1283 ><?php _e( 'Activate' ); ?></a> 1228 1284 <# } #> 1229 1285 <# } else { #> 1230 <?php1231 /* translators: %s: Theme name. */1232 $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );1233 ?>1234 1286 <# if ( ! data.blockTheme ) { #> 1235 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 1287 <?php 1288 /* translators: %s: Theme name. */ 1289 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1290 ?> 1291 <a class="button button-primary hide-if-no-customize disabled" 1292 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1293 ><?php _e( 'Live Preview' ); ?></a> 1236 1294 <# } #> 1295 1237 1296 <# if ( data.actions.activate ) { #> 1238 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1297 <?php 1298 /* translators: %s: Theme name. */ 1299 $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); 1300 ?> 1301 <a class="button disabled" 1302 aria-label="<?php echo esc_attr( $aria_label ); ?>" 1303 ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1239 1304 <# } #> 1240 1305 <# } #> … … 1246 1311 $aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' ); 1247 1312 ?> 1248 <a href="{{{ data.actions['delete'] }}}" class="button delete-theme" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Delete' ); ?></a> 1313 <a class="button delete-theme" 1314 href="{{{ data.actions['delete'] }}}" 1315 aria-label="<?php echo esc_attr( $aria_label ); ?>" 1316 ><?php _e( 'Delete' ); ?></a> 1249 1317 <# } #> 1250 1318 </div>
Note: See TracChangeset
for help on using the changeset viewer.