wp/wp-admin/theme-install.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Administration
     6  * @subpackage Administration
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    10 require_once __DIR__ . '/admin.php';
    11 require( ABSPATH . 'wp-admin/includes/theme-install.php' );
    11 require ABSPATH . 'wp-admin/includes/theme-install.php';
    12 
    12 
    13 wp_reset_vars( array( 'tab' ) );
    13 wp_reset_vars( array( 'tab' ) );
    14 
    14 
    15 if ( ! current_user_can( 'install_themes' ) ) {
    15 if ( ! current_user_can( 'install_themes' ) ) {
    16 	wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
    16 	wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
    17 }
    17 }
    18 
    18 
    19 if ( is_multisite() && ! is_network_admin() ) {
    19 if ( is_multisite() && ! is_network_admin() ) {
    20 	wp_redirect( network_admin_url( 'theme-install.php' ) );
    20 	wp_redirect( network_admin_url( 'theme-install.php' ) );
    21 	exit();
    21 	exit;
    22 }
    22 }
    23 
    23 
    24 $title       = __( 'Add Themes' );
    24 $title       = __( 'Add Themes' );
    25 $parent_file = 'themes.php';
    25 $parent_file = 'themes.php';
    26 
    26 
    52 			'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),
    52 			'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),
    53 		),
    53 		),
    54 		'l10n'            => array(
    54 		'l10n'            => array(
    55 			'addNew'              => __( 'Add New Theme' ),
    55 			'addNew'              => __( 'Add New Theme' ),
    56 			'search'              => __( 'Search Themes' ),
    56 			'search'              => __( 'Search Themes' ),
    57 			'searchPlaceholder'   => __( 'Search themes...' ), // placeholder (no ellipsis)
    57 			'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).
    58 			'upload'              => __( 'Upload Theme' ),
    58 			'upload'              => __( 'Upload Theme' ),
    59 			'back'                => __( 'Back' ),
    59 			'back'                => __( 'Back' ),
    60 			'error'               => sprintf(
    60 			'error'               => sprintf(
    61 				/* translators: %s: support forums URL */
    61 				/* translators: %s: Support forums URL. */
    62 				__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
    62 				__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
    63 				__( 'https://wordpress.org/support/' )
    63 				__( 'https://wordpress.org/support/forums/' )
    64 			),
    64 			),
    65 			'tryAgain'            => __( 'Try Again' ),
    65 			'tryAgain'            => __( 'Try Again' ),
       
    66 			/* translators: %d: Number of themes. */
    66 			'themesFound'         => __( 'Number of Themes found: %d' ),
    67 			'themesFound'         => __( 'Number of Themes found: %d' ),
    67 			'noThemesFound'       => __( 'No themes found. Try a different search.' ),
    68 			'noThemesFound'       => __( 'No themes found. Try a different search.' ),
    68 			'collapseSidebar'     => __( 'Collapse Sidebar' ),
    69 			'collapseSidebar'     => __( 'Collapse Sidebar' ),
    69 			'expandSidebar'       => __( 'Expand Sidebar' ),
    70 			'expandSidebar'       => __( 'Expand Sidebar' ),
    70 			/* translators: accessibility text */
    71 			/* translators: Accessibility text. */
    71 			'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
    72 			'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
    72 		),
    73 		),
    73 		'installedThemes' => array_keys( $installed_themes ),
    74 		'installedThemes' => array_keys( $installed_themes ),
       
    75 		'activeTheme'     => get_stylesheet(),
    74 	)
    76 	)
    75 );
    77 );
    76 
    78 
    77 wp_enqueue_script( 'theme' );
    79 wp_enqueue_script( 'theme' );
    78 wp_enqueue_script( 'updates' );
    80 wp_enqueue_script( 'updates' );
    90 	do_action( "install_themes_pre_{$tab}" );
    92 	do_action( "install_themes_pre_{$tab}" );
    91 }
    93 }
    92 
    94 
    93 $help_overview =
    95 $help_overview =
    94 	'<p>' . sprintf(
    96 	'<p>' . sprintf(
    95 		/* translators: %s: Theme Directory URL */
    97 		/* translators: %s: Theme Directory URL. */
    96 			__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
    98 		__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
    97 		__( 'https://wordpress.org/themes/' )
    99 		__( 'https://wordpress.org/themes/' )
    98 	) . '</p>' .
   100 	) . '</p>' .
    99 	'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
   101 	'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
   100 	'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
   102 	'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
   101 	'<p>' . sprintf(
   103 	'<p>' . sprintf(
   102 		/* translators: %s: /wp-content/themes */
   104 		/* translators: %s: /wp-content/themes */
   103 			__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),
   105 		__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),
   104 		'<code>/wp-content/themes</code>'
   106 		'<code>/wp-content/themes</code>'
   105 	) . '</p>';
   107 	) . '</p>';
   106 
   108 
   107 get_current_screen()->add_help_tab(
   109 get_current_screen()->add_help_tab(
   108 	array(
   110 	array(
   124 	)
   126 	)
   125 );
   127 );
   126 
   128 
   127 get_current_screen()->set_help_sidebar(
   129 get_current_screen()->set_help_sidebar(
   128 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
   130 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
   129 	'<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes#Adding_New_Themes">Documentation on Adding New Themes</a>' ) . '</p>' .
   131 	'<p>' . __( '<a href="https://wordpress.org/support/article/using-themes/#adding-new-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
   130 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
   132 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
   131 );
   133 );
   132 
   134 
   133 include( ABSPATH . 'wp-admin/admin-header.php' );
   135 require_once ABSPATH . 'wp-admin/admin-header.php';
   134 
   136 
   135 ?>
   137 ?>
   136 <div class="wrap">
   138 <div class="wrap">
   137 	<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
   139 	<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
   138 
   140 
   205 			<div class="buttons">
   207 			<div class="buttons">
   206 				<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
   208 				<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
   207 				<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
   209 				<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
   208 			</div>
   210 			</div>
   209 		<?php
   211 		<?php
   210 		$feature_list = get_theme_feature_list( false ); // Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.
   212 		// Use the core list, rather than the .org API, due to inconsistencies
       
   213 		// and to ensure tags are translated.
       
   214 		$feature_list = get_theme_feature_list( false );
       
   215 
   211 		foreach ( $feature_list as $feature_name => $features ) {
   216 		foreach ( $feature_list as $feature_name => $features ) {
   212 			echo '<fieldset class="filter-group">';
   217 			echo '<fieldset class="filter-group">';
   213 			$feature_name = esc_html( $feature_name );
   218 			$feature_name = esc_html( $feature_name );
   214 			echo '<legend>' . $feature_name . '</legend>';
   219 			echo '<legend>' . $feature_name . '</legend>';
   215 			echo '<div class="filter-group-feature">';
   220 			echo '<div class="filter-group-feature">';
   264 			<img src="{{ data.screenshot_url }}" alt="" />
   269 			<img src="{{ data.screenshot_url }}" alt="" />
   265 		</div>
   270 		</div>
   266 	<# } else { #>
   271 	<# } else { #>
   267 		<div class="theme-screenshot blank"></div>
   272 		<div class="theme-screenshot blank"></div>
   268 	<# } #>
   273 	<# } #>
       
   274 
       
   275 	<# if ( data.installed ) { #>
       
   276 		<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
       
   277 	<# } #>
       
   278 
       
   279 	<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
       
   280 		<div class="notice notice-error notice-alt"><p>
       
   281 			<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
       
   282 				<?php
       
   283 				_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
       
   284 				if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
       
   285 					printf(
       
   286 						/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
       
   287 						' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
       
   288 						self_admin_url( 'update-core.php' ),
       
   289 						esc_url( wp_get_update_php_url() )
       
   290 					);
       
   291 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   292 				} elseif ( current_user_can( 'update_core' ) ) {
       
   293 					printf(
       
   294 						/* translators: %s: URL to WordPress Updates screen. */
       
   295 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
   296 						self_admin_url( 'update-core.php' )
       
   297 					);
       
   298 				} elseif ( current_user_can( 'update_php' ) ) {
       
   299 					printf(
       
   300 						/* translators: %s: URL to Update PHP page. */
       
   301 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
   302 						esc_url( wp_get_update_php_url() )
       
   303 					);
       
   304 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   305 				}
       
   306 				?>
       
   307 			<# } else if ( ! data.compatible_wp ) { #>
       
   308 				<?php
       
   309 				_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
       
   310 				if ( current_user_can( 'update_core' ) ) {
       
   311 					printf(
       
   312 						/* translators: %s: URL to WordPress Updates screen. */
       
   313 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
   314 						self_admin_url( 'update-core.php' )
       
   315 					);
       
   316 				}
       
   317 				?>
       
   318 			<# } else if ( ! data.compatible_php ) { #>
       
   319 				<?php
       
   320 				_e( 'This theme doesn&#8217;t work with your version of PHP.' );
       
   321 				if ( current_user_can( 'update_php' ) ) {
       
   322 					printf(
       
   323 						/* translators: %s: URL to Update PHP page. */
       
   324 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
   325 						esc_url( wp_get_update_php_url() )
       
   326 					);
       
   327 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   328 				}
       
   329 				?>
       
   330 			<# } #>
       
   331 		</p></div>
       
   332 	<# } #>
       
   333 
   269 	<span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
   334 	<span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
   270 	<div class="theme-author">
   335 	<div class="theme-author">
   271 		<?php
   336 		<?php
   272 		/* translators: %s: Theme author name */
   337 		/* translators: %s: Theme author name. */
   273 		printf( __( 'By %s' ), '{{ data.author }}' );
   338 		printf( __( 'By %s' ), '{{ data.author }}' );
   274 		?>
   339 		?>
   275 	</div>
   340 	</div>
   276 
   341 
   277 	<div class="theme-id-container">
   342 	<div class="theme-id-container">
   278 		<h3 class="theme-name">{{ data.name }}</h3>
   343 		<h3 class="theme-name">{{ data.name }}</h3>
   279 
   344 
   280 		<div class="theme-actions">
   345 		<div class="theme-actions">
   281 			<# if ( data.installed ) { #>
   346 			<# if ( data.installed ) { #>
   282 				<?php
   347 				<# if ( data.compatible_wp && data.compatible_php ) { #>
   283 				/* translators: %s: Theme name */
   348 					<?php
   284 				$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
   349 					/* translators: %s: Theme name. */
   285 				?>
   350 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
   286 				<# if ( data.activate_url ) { #>
   351 					?>
   287 					<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
   352 					<# if ( data.activate_url ) { #>
   288 				<# } #>
   353 						<# if ( ! data.active ) { #>
   289 				<# if ( data.customize_url ) { #>
   354 							<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
   290 					<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
   355 						<# } else { #>
       
   356 							<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
       
   357 						<# } #>
       
   358 					<# } #>
       
   359 					<# if ( data.customize_url ) { #>
       
   360 						<# if ( ! data.active ) { #>
       
   361 							<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
       
   362 						<# } else { #>
       
   363 							<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
       
   364 						<# } #>
       
   365 					<# } else { #>
       
   366 						<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
       
   367 					<# } #>
   291 				<# } else { #>
   368 				<# } else { #>
   292 					<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
   369 					<?php
       
   370 					/* translators: %s: Theme name. */
       
   371 					$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
       
   372 					?>
       
   373 					<# if ( data.activate_url ) { #>
       
   374 						<a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
       
   375 					<# } #>
       
   376 					<# if ( data.customize_url ) { #>
       
   377 						<a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
       
   378 					<# } else { #>
       
   379 						<button class="button disabled"><?php _e( 'Preview' ); ?></button>
       
   380 					<# } #>
   293 				<# } #>
   381 				<# } #>
   294 			<# } else { #>
   382 			<# } else { #>
   295 				<?php
   383 				<# if ( data.compatible_wp && data.compatible_php ) { #>
   296 				/* translators: %s: Theme name */
   384 					<?php
   297 				$aria_label = sprintf( __( 'Install %s' ), '{{ data.name }}' );
   385 					/* translators: %s: Theme name. */
   298 				?>
   386 					$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
   299 				<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
   387 					?>
   300 				<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
   388 					<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
       
   389 					<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
       
   390 				<# } else { #>
       
   391 					<?php
       
   392 					/* translators: %s: Theme name. */
       
   393 					$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
       
   394 					?>
       
   395 					<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
       
   396 					<button class="button disabled"><?php _e( 'Preview' ); ?></button>
       
   397 				<# } #>
   301 			<# } #>
   398 			<# } #>
   302 		</div>
   399 		</div>
   303 	</div>
   400 	</div>
   304 
       
   305 	<# if ( data.installed ) { #>
       
   306 		<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
       
   307 	<# } #>
       
   308 </script>
   401 </script>
   309 
   402 
   310 <script id="tmpl-theme-preview" type="text/template">
   403 <script id="tmpl-theme-preview" type="text/template">
   311 	<div class="wp-full-overlay-sidebar">
   404 	<div class="wp-full-overlay-sidebar">
   312 		<div class="wp-full-overlay-header">
   405 		<div class="wp-full-overlay-header">
   313 			<button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
   406 			<button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
   314 			<button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
   407 			<button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
   315 			<button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
   408 			<button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
   316 			<# if ( data.installed ) { #>
   409 			<# if ( data.installed ) { #>
   317 				<a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a>
   410 				<# if ( data.compatible_wp && data.compatible_php ) { #>
       
   411 					<?php
       
   412 					/* translators: %s: Theme name. */
       
   413 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
       
   414 					?>
       
   415 					<# if ( ! data.active ) { #>
       
   416 						<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
       
   417 					<# } else { #>
       
   418 						<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
       
   419 					<# } #>
       
   420 				<# } else { #>
       
   421 					<a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
       
   422 				<# } #>
   318 			<# } else { #>
   423 			<# } else { #>
   319 				<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
   424 				<# if ( data.compatible_wp && data.compatible_php ) { #>
       
   425 					<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
       
   426 				<# } else { #>
       
   427 					<a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
       
   428 				<# } #>
   320 			<# } #>
   429 			<# } #>
   321 		</div>
   430 		</div>
   322 		<div class="wp-full-overlay-sidebar-content">
   431 		<div class="wp-full-overlay-sidebar-content">
   323 			<div class="install-theme-info">
   432 			<div class="install-theme-info">
   324 				<h3 class="theme-name">{{ data.name }}</h3>
   433 				<h3 class="theme-name">{{ data.name }}</h3>
   325 					<span class="theme-by">
   434 					<span class="theme-by">
   326 						<?php
   435 						<?php
   327 						/* translators: %s: Theme author name */
   436 						/* translators: %s: Theme author name. */
   328 						printf( __( 'By %s' ), '{{ data.author }}' );
   437 						printf( __( 'By %s' ), '{{ data.author }}' );
   329 						?>
   438 						?>
   330 					</span>
   439 					</span>
   331 
   440 
   332 					<img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
   441 					<img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
   335 						<# if ( data.rating ) { #>
   444 						<# if ( data.rating ) { #>
   336 							<div class="theme-rating">
   445 							<div class="theme-rating">
   337 								{{{ data.stars }}}
   446 								{{{ data.stars }}}
   338 								<a class="num-ratings" href="{{ data.reviews_url }}">
   447 								<a class="num-ratings" href="{{ data.reviews_url }}">
   339 									<?php
   448 									<?php
   340 									/* translators: %s: number of ratings */
   449 									/* translators: %s: Number of ratings. */
   341 									echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
   450 									printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
   342 									?>
   451 									?>
   343 								</a>
   452 								</a>
   344 							</div>
   453 							</div>
   345 						<# } else { #>
   454 						<# } else { #>
   346 							<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
   455 							<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
   347 						<# } #>
   456 						<# } #>
       
   457 
   348 						<div class="theme-version">
   458 						<div class="theme-version">
   349 							<?php
   459 							<?php
   350 							/* translators: %s: Theme version */
   460 							/* translators: %s: Theme version. */
   351 							printf( __( 'Version: %s' ), '{{ data.version }}' );
   461 							printf( __( 'Version: %s' ), '{{ data.version }}' );
   352 							?>
   462 							?>
   353 						</div>
   463 						</div>
       
   464 
       
   465 						<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
       
   466 							<div class="notice notice-error notice-alt notice-large"><p>
       
   467 								<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
       
   468 									<?php
       
   469 									_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
       
   470 									if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
       
   471 										printf(
       
   472 											/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
       
   473 											' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
       
   474 											self_admin_url( 'update-core.php' ),
       
   475 											esc_url( wp_get_update_php_url() )
       
   476 										);
       
   477 										wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   478 									} elseif ( current_user_can( 'update_core' ) ) {
       
   479 										printf(
       
   480 											/* translators: %s: URL to WordPress Updates screen. */
       
   481 											' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
   482 											self_admin_url( 'update-core.php' )
       
   483 										);
       
   484 									} elseif ( current_user_can( 'update_php' ) ) {
       
   485 										printf(
       
   486 											/* translators: %s: URL to Update PHP page. */
       
   487 											' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
   488 											esc_url( wp_get_update_php_url() )
       
   489 										);
       
   490 										wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   491 									}
       
   492 									?>
       
   493 								<# } else if ( ! data.compatible_wp ) { #>
       
   494 									<?php
       
   495 									_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
       
   496 									if ( current_user_can( 'update_core' ) ) {
       
   497 										printf(
       
   498 											/* translators: %s: URL to WordPress Updates screen. */
       
   499 											' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
   500 											self_admin_url( 'update-core.php' )
       
   501 										);
       
   502 									}
       
   503 									?>
       
   504 								<# } else if ( ! data.compatible_php ) { #>
       
   505 									<?php
       
   506 									_e( 'This theme doesn&#8217;t work with your version of PHP.' );
       
   507 									if ( current_user_can( 'update_php' ) ) {
       
   508 										printf(
       
   509 											/* translators: %s: URL to Update PHP page. */
       
   510 											' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
   511 											esc_url( wp_get_update_php_url() )
       
   512 										);
       
   513 										wp_update_php_annotation( '</p><p><em>', '</em>' );
       
   514 									}
       
   515 									?>
       
   516 								<# } #>
       
   517 							</p></div>
       
   518 						<# } #>
       
   519 
   354 						<div class="theme-description">{{{ data.description }}}</div>
   520 						<div class="theme-description">{{{ data.description }}}</div>
   355 					</div>
   521 					</div>
   356 				</div>
   522 				</div>
   357 			</div>
   523 			</div>
   358 			<div class="wp-full-overlay-footer">
   524 			<div class="wp-full-overlay-footer">
   369 
   535 
   370 <?php
   536 <?php
   371 wp_print_request_filesystem_credentials_modal();
   537 wp_print_request_filesystem_credentials_modal();
   372 wp_print_admin_notice_templates();
   538 wp_print_admin_notice_templates();
   373 
   539 
   374 include( ABSPATH . 'wp-admin/admin-footer.php' );
   540 require_once ABSPATH . 'wp-admin/admin-footer.php';