Changeset 61195
- Timestamp:
- 11/10/2025 09:04:46 PM (2 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
-
includes/class-theme-installer-skin.php (modified) (1 diff)
-
themes.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-theme-installer-skin.php
r59513 r61195 122 122 $install_actions = array(); 123 123 124 if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) && ! $theme_info->is_block_theme() ) { 125 $customize_url = add_query_arg( 126 array( 127 'theme' => urlencode( $stylesheet ), 128 'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ), 129 ), 130 admin_url( 'customize.php' ) 131 ); 124 if ( current_user_can( 'edit_theme_options' ) && ( $theme_info->is_block_theme() || current_user_can( 'customize' ) ) ) { 125 if ( $theme_info->is_block_theme() ) { 126 $customize_url = add_query_arg( 127 array( 128 'wp_theme_preview' => urlencode( $stylesheet ), 129 'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ), 130 ), 131 admin_url( 'site-editor.php' ) 132 ); 133 } else { 134 $customize_url = add_query_arg( 135 array( 136 'theme' => urlencode( $stylesheet ), 137 'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ), 138 ), 139 admin_url( 'customize.php' ) 140 ); 141 } 132 142 133 143 $install_actions['preview'] = sprintf( -
trunk/src/wp-admin/themes.php
r59960 r61195 646 646 647 647 <?php 648 if ( ! $theme['blockTheme'] &¤t_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {648 if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 649 649 /* translators: %s: Theme name. */ 650 650 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); … … 1035 1035 ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> 1036 1036 1037 <# if ( ! data.blockTheme ) { #> 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> 1045 <# } #> 1037 <?php 1038 /* translators: %s: Theme name. */ 1039 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1040 ?> 1041 <a class="button button-primary hide-if-no-customize disabled" 1042 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1043 ><?php _e( 'Live Preview' ); ?></a> 1046 1044 <# } #> 1047 1045 <# } #> … … 1262 1260 <div class="inactive-theme"> 1263 1261 <# if ( data.compatibleWP && data.compatiblePHP ) { #> 1264 <# if ( ! data.blockTheme ) { #> 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> 1273 <# } #> 1262 <?php 1263 /* translators: %s: Theme name. */ 1264 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1265 ?> 1266 <a class="button button-primary load-customize hide-if-no-customize" 1267 href="{{{ data.actions.customize }}}" 1268 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1269 ><?php _e( 'Live Preview' ); ?></a> 1274 1270 1275 1271 <# if ( data.actions.activate ) { #> … … 1284 1280 <# } #> 1285 1281 <# } else { #> 1286 <# if ( ! data.blockTheme ) { #> 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> 1294 <# } #> 1282 <?php 1283 /* translators: %s: Theme name. */ 1284 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 1285 ?> 1286 <a class="button button-primary hide-if-no-customize disabled" 1287 aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" 1288 ><?php _e( 'Live Preview' ); ?></a> 1295 1289 1296 1290 <# if ( data.actions.activate ) { #>
Note: See TracChangeset
for help on using the changeset viewer.