Changeset 56059
- Timestamp:
- 06/27/2023 09:34:34 AM (16 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/admin-filters.php
r54122 r56059 169 169 // Append '(Draft)' to draft page titles in the privacy page dropdown. 170 170 add_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 ); 171 172 // Attaches filters to enable theme previews in the Site Editor. 173 if ( ! empty( $_GET['wp_theme_preview'] ) ) { 174 add_filter( 'stylesheet', 'wp_get_theme_preview_path' ); 175 add_filter( 'template', 'wp_get_theme_preview_path' ); 176 add_action( 'init', 'wp_attach_theme_preview_middleware' ); 177 } -
trunk/src/wp-admin/includes/admin.php
r54797 r56059 72 72 /** WordPress Theme Administration API */ 73 73 require_once ABSPATH . 'wp-admin/includes/theme.php'; 74 require_once ABSPATH . 'wp-admin/includes/theme-previews.php'; 74 75 75 76 /** WordPress Privacy Functions */ -
trunk/src/wp-admin/includes/theme.php
r55276 r56059 712 712 713 713 if ( $is_block_theme && $can_edit_theme_options ) { 714 $customize_action = esc_url( admin_url( 'site-editor.php' ) ); 714 $customize_action = admin_url( 'site-editor.php' ); 715 if ( $current_theme !== $slug ) { 716 $customize_action = add_query_arg( 'wp_theme_preview', $slug, $customize_action ); 717 } 715 718 } elseif ( ! $is_block_theme && $can_customize && $can_edit_theme_options ) { 716 $customize_action = esc_url( 717 add_query_arg( 718 array( 719 'return' => urlencode( sanitize_url( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ), 720 ), 721 wp_customize_url( $slug ) 722 ) 719 $customize_action = wp_customize_url( $slug ); 720 } 721 if ( null !== $customize_action ) { 722 $customize_action = add_query_arg( 723 array( 724 'return' => urlencode( sanitize_url( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ), 725 ), 726 $customize_action 723 727 ); 728 $customize_action = esc_url( $customize_action ); 724 729 } 725 730 -
trunk/src/wp-admin/themes.php
r55414 r56059 556 556 <a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 557 557 <?php 558 if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 558 // Only classic themes require the "customize" capability. 559 if ( current_user_can( 'edit_theme_options' ) && ( $theme['blockTheme'] || current_user_can( 'customize' ) ) ) { 559 560 /* translators: %s: Theme name. */ 560 561 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); … … 915 916 ?> 916 917 <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 917 <# if ( ! data.blockTheme ) { #> 918 <?php 919 /* translators: %s: Theme name. */ 920 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 921 ?> 922 <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> 923 <# } #> 918 <?php 919 /* translators: %s: Theme name. */ 920 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 921 ?> 922 <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> 924 923 <# } else { #> 925 924 <?php
Note: See TracChangeset
for help on using the changeset viewer.