wp/wp-includes/customize/class-wp-customize-theme-control.php
changeset 19 3d72ae0968f4
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-includes/customize/class-wp-customize-theme-control.php	Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/customize/class-wp-customize-theme-control.php	Tue Sep 27 16:37:53 2022 +0200
@@ -74,7 +74,7 @@
 
 			<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>
 				<div class="theme-screenshot">
-					<img data-src="{{ data.theme.screenshot[0] }}" alt="" />
+					<img data-src="{{ data.theme.screenshot[0] }}?ver={{ data.theme.version }}" alt="" />
 				</div>
 			<# } else { #>
 				<div class="theme-screenshot blank"></div>
@@ -113,7 +113,7 @@
 								<?php
 								printf(
 									/* translators: %s: Theme name. */
-									__( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
+									__( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
 									'{{{ data.theme.name }}}'
 								);
 								if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
@@ -143,7 +143,7 @@
 								<?php
 								printf(
 									/* translators: %s: Theme name. */
-									__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
+									__( 'There is a new version of %s available, but it does not work with your version of WordPress.' ),
 									'{{{ data.theme.name }}}'
 								);
 								if ( current_user_can( 'update_core' ) ) {
@@ -158,7 +158,7 @@
 								<?php
 								printf(
 									/* translators: %s: Theme name. */
-									__( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
+									__( 'There is a new version of %s available, but it does not work with your version of PHP.' ),
 									'{{{ data.theme.name }}}'
 								);
 								if ( current_user_can( 'update_php' ) ) {
@@ -180,7 +180,7 @@
 				<div class="notice notice-error notice-alt"><p>
 					<# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #>
 						<?php
-						_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
+						_e( 'This theme does not work with your versions of WordPress and PHP.' );
 						if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
 							printf(
 								/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
@@ -206,7 +206,7 @@
 						?>
 					<# } else if ( ! data.theme.compatibleWP ) { #>
 						<?php
-						_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
+						_e( 'This theme does not work with your version of WordPress.' );
 						if ( current_user_can( 'update_core' ) ) {
 							printf(
 								/* translators: %s: URL to WordPress Updates screen. */
@@ -217,7 +217,7 @@
 						?>
 					<# } else if ( ! data.theme.compatiblePHP ) { #>
 						<?php
-						_e( 'This theme doesn&#8217;t work with your version of PHP.' );
+						_e( 'This theme does not work with your version of PHP.' );
 						if ( current_user_can( 'update_php' ) ) {
 							printf(
 								/* translators: %s: URL to Update PHP page. */
@@ -242,17 +242,47 @@
 				</div>
 				<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
 			<# } else if ( 'installed' === data.theme.type ) { #>
-				<div class="theme-id-container">
-					<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
-					<div class="theme-actions">
-						<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
-							<button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></button>
-						<# } else { #>
-							<button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $preview_label ); ?>"><?php _e( 'Live Preview' ); ?></button>
-						<# } #>
+				<# if ( data.theme.blockTheme ) { #>
+					<div class="theme-id-container">
+						<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
+						<div class="theme-actions">
+							<# if ( data.theme.actions.activate ) { #>
+								<?php
+									/* translators: %s: Theme name. */
+									$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
+								?>
+								<a href="{{{ data.theme.actions.activate }}}" class="button button-primary activate" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
+							<# } #>
+						</div>
 					</div>
-				</div>
-				<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
+					<div class="notice notice-error notice-alt"><p>
+					<?php
+						_e( 'This theme doesn\'t support Customizer.' );
+					?>
+					<# if ( data.theme.actions.activate ) { #>
+						<?php
+							echo ' ';
+							printf(
+								/* translators: %s: URL to the themes page (also it activates the theme). */
+								__( 'However, you can still <a href="%s">activate this theme</a>, and use the Site Editor to customize it.' ),
+								'{{{ data.theme.actions.activate }}}'
+							);
+						?>
+					<# } #>
+					</p></div>
+				<# } else { #>
+					<div class="theme-id-container">
+						<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
+						<div class="theme-actions">
+							<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #>
+								<button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></button>
+							<# } else { #>
+								<button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $preview_label ); ?>"><?php _e( 'Live Preview' ); ?></button>
+							<# } #>
+						</div>
+					</div>
+					<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
+				<# } #>
 			<# } else { #>
 				<div class="theme-id-container">
 					<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>