Changeset 52353
- Timestamp:
- 12/10/2021 08:31:57 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r52346 r52353 308 308 309 309 if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { 310 $forbidden_paths = array( 311 'themes.php', 312 'theme-editor.php', 313 'site-editor.php', 314 'edit.php?post_type=wp_navigation', 315 ); 316 310 317 foreach ( (array) $submenu['themes.php'] as $item ) { 311 318 $class = ''; 312 if ( 'themes.php' === $item[2] || 'theme-editor.php' === $item[2] || 0 === strpos( $item[2], 'customize.php' ) ) { 319 320 if ( in_array( $item[2], $forbidden_paths, true ) || str_starts_with( $item[2], 'customize.php' ) ) { 313 321 continue; 314 322 } … … 542 550 <a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 543 551 <?php 544 if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {552 if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 545 553 /* translators: %s: Theme name. */ 546 554 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); … … 554 562 ?> 555 563 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 556 <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>564 <?php if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> 557 565 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 558 566 <?php } ?> … … 914 922 ?> 915 923 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 916 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 924 <# if ( ! data.blockTheme ) { #> 925 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 926 <# } #> 917 927 <# } #> 918 928 <# } #> … … 1122 1132 <a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 1123 1133 <# } #> 1124 <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> 1134 <# if ( ! data.blockTheme ) { #> 1135 <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> 1136 <# } #> 1125 1137 <# } else { #> 1126 1138 <?php … … 1131 1143 <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1132 1144 <# } #> 1133 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 1145 <# if ( ! data.blockTheme ) { #> 1146 <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a> 1147 <# } #> 1134 1148 <# } #> 1135 1149 </div>
Note: See TracChangeset
for help on using the changeset viewer.