ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

theme-install.php (22199B)


      1 <?php
      2 /**
      3  * Install theme administration panel.
      4  *
      5  * @package WordPress
      6  * @subpackage Administration
      7  */
      8 
      9 /** WordPress Administration Bootstrap */
     10 require_once __DIR__ . '/admin.php';
     11 require ABSPATH . 'wp-admin/includes/theme-install.php';
     12 
     13 wp_reset_vars( array( 'tab' ) );
     14 
     15 if ( ! current_user_can( 'install_themes' ) ) {
     16 	wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
     17 }
     18 
     19 if ( is_multisite() && ! is_network_admin() ) {
     20 	wp_redirect( network_admin_url( 'theme-install.php' ) );
     21 	exit;
     22 }
     23 
     24 $title       = __( 'Add Themes' );
     25 $parent_file = 'themes.php';
     26 
     27 if ( ! is_network_admin() ) {
     28 	$submenu_file = 'themes.php';
     29 }
     30 
     31 $installed_themes = search_theme_directories();
     32 
     33 if ( false === $installed_themes ) {
     34 	$installed_themes = array();
     35 }
     36 
     37 foreach ( $installed_themes as $k => $v ) {
     38 	if ( false !== strpos( $k, '/' ) ) {
     39 		unset( $installed_themes[ $k ] );
     40 	}
     41 }
     42 
     43 wp_localize_script(
     44 	'theme',
     45 	'_wpThemeSettings',
     46 	array(
     47 		'themes'          => false,
     48 		'settings'        => array(
     49 			'isInstall'  => true,
     50 			'canInstall' => current_user_can( 'install_themes' ),
     51 			'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
     52 			'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH ),
     53 		),
     54 		'l10n'            => array(
     55 			'addNew'              => __( 'Add New Theme' ),
     56 			'search'              => __( 'Search Themes' ),
     57 			'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).
     58 			'upload'              => __( 'Upload Theme' ),
     59 			'back'                => __( 'Back' ),
     60 			'error'               => sprintf(
     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>.' ),
     63 				__( 'https://wordpress.org/support/forums/' )
     64 			),
     65 			'tryAgain'            => __( 'Try Again' ),
     66 			/* translators: %d: Number of themes. */
     67 			'themesFound'         => __( 'Number of Themes found: %d' ),
     68 			'noThemesFound'       => __( 'No themes found. Try a different search.' ),
     69 			'collapseSidebar'     => __( 'Collapse Sidebar' ),
     70 			'expandSidebar'       => __( 'Expand Sidebar' ),
     71 			/* translators: Accessibility text. */
     72 			'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
     73 		),
     74 		'installedThemes' => array_keys( $installed_themes ),
     75 		'activeTheme'     => get_stylesheet(),
     76 	)
     77 );
     78 
     79 wp_enqueue_script( 'theme' );
     80 wp_enqueue_script( 'updates' );
     81 
     82 if ( $tab ) {
     83 	/**
     84 	 * Fires before each of the tabs are rendered on the Install Themes page.
     85 	 *
     86 	 * The dynamic portion of the hook name, `$tab`, refers to the current
     87 	 * theme installation tab.
     88 	 *
     89 	 * Possible hook names include:
     90 	 *
     91 	 *  - `install_themes_pre_dashboard`
     92 	 *  - `install_themes_pre_featured`
     93 	 *  - `install_themes_pre_new`
     94 	 *  - `install_themes_pre_search`
     95 	 *  - `install_themes_pre_updated`
     96 	 *  - `install_themes_pre_upload`
     97 	 *
     98 	 * @since 2.8.0
     99 	 */
    100 	do_action( "install_themes_pre_{$tab}" );
    101 }
    102 
    103 $help_overview =
    104 	'<p>' . sprintf(
    105 		/* translators: %s: Theme Directory URL. */
    106 		__( '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.' ),
    107 		__( 'https://wordpress.org/themes/' )
    108 	) . '</p>' .
    109 	'<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>' .
    110 	'<p>' . __( 'Alternately, you can browse the themes that are Popular or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
    111 	'<p>' . sprintf(
    112 		/* translators: %s: /wp-content/themes */
    113 		__( '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.' ),
    114 		'<code>/wp-content/themes</code>'
    115 	) . '</p>';
    116 
    117 get_current_screen()->add_help_tab(
    118 	array(
    119 		'id'      => 'overview',
    120 		'title'   => __( 'Overview' ),
    121 		'content' => $help_overview,
    122 	)
    123 );
    124 
    125 $help_installing =
    126 	'<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you&#8217;re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' .
    127 	'<p>' . __( 'To install the theme so you can preview it with your site&#8217;s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme&#8217;s thumbnail image.' ) . '</p>';
    128 
    129 get_current_screen()->add_help_tab(
    130 	array(
    131 		'id'      => 'installing',
    132 		'title'   => __( 'Previewing and Installing' ),
    133 		'content' => $help_installing,
    134 	)
    135 );
    136 
    137 get_current_screen()->set_help_sidebar(
    138 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    139 	'<p>' . __( '<a href="https://wordpress.org/support/article/using-themes/#adding-new-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
    140 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    141 );
    142 
    143 require_once ABSPATH . 'wp-admin/admin-header.php';
    144 
    145 ?>
    146 <div class="wrap">
    147 	<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
    148 
    149 	<?php
    150 
    151 	/**
    152 	 * Filters the tabs shown on the Add Themes screen.
    153 	 *
    154 	 * This filter is for backward compatibility only, for the suppression of the upload tab.
    155 	 *
    156 	 * @since 2.8.0
    157 	 *
    158 	 * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
    159 	 */
    160 	$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
    161 	if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
    162 		echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
    163 	}
    164 	?>
    165 
    166 	<hr class="wp-header-end">
    167 
    168 	<div class="error hide-if-js">
    169 		<p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
    170 	</div>
    171 
    172 	<div class="upload-theme">
    173 	<?php install_themes_upload(); ?>
    174 	</div>
    175 
    176 	<h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
    177 
    178 	<div class="wp-filter hide-if-no-js">
    179 		<div class="filter-count">
    180 			<span class="count theme-count"></span>
    181 		</div>
    182 
    183 		<ul class="filter-links">
    184 			<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
    185 			<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
    186 			<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
    187 		</ul>
    188 
    189 		<button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
    190 
    191 		<form class="search-form"></form>
    192 
    193 		<div class="favorites-form">
    194 			<?php
    195 			$action = 'save_wporg_username_' . get_current_user_id();
    196 			if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
    197 				$user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
    198 				update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
    199 			} else {
    200 				$user = get_user_option( 'wporg_favorites' );
    201 			}
    202 			?>
    203 			<p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
    204 
    205 			<p>
    206 				<label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
    207 				<input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
    208 				<input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
    209 				<input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
    210 			</p>
    211 		</div>
    212 
    213 		<div class="filter-drawer">
    214 			<div class="buttons">
    215 				<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
    216 				<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
    217 			</div>
    218 		<?php
    219 		// Use the core list, rather than the .org API, due to inconsistencies
    220 		// and to ensure tags are translated.
    221 		$feature_list = get_theme_feature_list( false );
    222 
    223 		foreach ( $feature_list as $feature_name => $features ) {
    224 			echo '<fieldset class="filter-group">';
    225 			$feature_name = esc_html( $feature_name );
    226 			echo '<legend>' . $feature_name . '</legend>';
    227 			echo '<div class="filter-group-feature">';
    228 			foreach ( $features as $feature => $feature_name ) {
    229 				$feature = esc_attr( $feature );
    230 				echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
    231 				echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label>';
    232 			}
    233 			echo '</div>';
    234 			echo '</fieldset>';
    235 		}
    236 		?>
    237 			<div class="buttons">
    238 				<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
    239 				<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
    240 			</div>
    241 			<div class="filtered-by">
    242 				<span><?php _e( 'Filtering by:' ); ?></span>
    243 				<div class="tags"></div>
    244 				<button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
    245 			</div>
    246 		</div>
    247 	</div>
    248 	<h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2>
    249 	<div class="theme-browser content-filterable"></div>
    250 	<div class="theme-install-overlay wp-full-overlay expanded"></div>
    251 
    252 	<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
    253 	<span class="spinner"></span>
    254 
    255 <?php
    256 if ( $tab ) {
    257 	/**
    258 	 * Fires at the top of each of the tabs on the Install Themes page.
    259 	 *
    260 	 * The dynamic portion of the hook name, `$tab`, refers to the current
    261 	 * theme installation tab.
    262 	 *
    263 	 * Possible hook names include:
    264 	 *
    265 	 *  - `install_themes_dashboard`
    266 	 *  - `install_themes_featured`
    267 	 *  - `install_themes_new`
    268 	 *  - `install_themes_search`
    269 	 *  - `install_themes_updated`
    270 	 *  - `install_themes_upload`
    271 	 *
    272 	 * @since 2.8.0
    273 	 *
    274 	 * @param int $paged Number of the current page of results being viewed.
    275 	 */
    276 	do_action( "install_themes_{$tab}", $paged );
    277 }
    278 ?>
    279 </div>
    280 
    281 <script id="tmpl-theme" type="text/template">
    282 	<# if ( data.screenshot_url ) { #>
    283 		<div class="theme-screenshot">
    284 			<img src="{{ data.screenshot_url }}" alt="" />
    285 		</div>
    286 	<# } else { #>
    287 		<div class="theme-screenshot blank"></div>
    288 	<# } #>
    289 
    290 	<# if ( data.installed ) { #>
    291 		<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
    292 	<# } #>
    293 
    294 	<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
    295 		<div class="notice notice-error notice-alt"><p>
    296 			<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
    297 				<?php
    298 				_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
    299 				if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    300 					printf(
    301 						/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    302 						' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
    303 						self_admin_url( 'update-core.php' ),
    304 						esc_url( wp_get_update_php_url() )
    305 					);
    306 					wp_update_php_annotation( '</p><p><em>', '</em>' );
    307 				} elseif ( current_user_can( 'update_core' ) ) {
    308 					printf(
    309 						/* translators: %s: URL to WordPress Updates screen. */
    310 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
    311 						self_admin_url( 'update-core.php' )
    312 					);
    313 				} elseif ( current_user_can( 'update_php' ) ) {
    314 					printf(
    315 						/* translators: %s: URL to Update PHP page. */
    316 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
    317 						esc_url( wp_get_update_php_url() )
    318 					);
    319 					wp_update_php_annotation( '</p><p><em>', '</em>' );
    320 				}
    321 				?>
    322 			<# } else if ( ! data.compatible_wp ) { #>
    323 				<?php
    324 				_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
    325 				if ( current_user_can( 'update_core' ) ) {
    326 					printf(
    327 						/* translators: %s: URL to WordPress Updates screen. */
    328 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
    329 						self_admin_url( 'update-core.php' )
    330 					);
    331 				}
    332 				?>
    333 			<# } else if ( ! data.compatible_php ) { #>
    334 				<?php
    335 				_e( 'This theme doesn&#8217;t work with your version of PHP.' );
    336 				if ( current_user_can( 'update_php' ) ) {
    337 					printf(
    338 						/* translators: %s: URL to Update PHP page. */
    339 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
    340 						esc_url( wp_get_update_php_url() )
    341 					);
    342 					wp_update_php_annotation( '</p><p><em>', '</em>' );
    343 				}
    344 				?>
    345 			<# } #>
    346 		</p></div>
    347 	<# } #>
    348 
    349 	<span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
    350 	<div class="theme-author">
    351 		<?php
    352 		/* translators: %s: Theme author name. */
    353 		printf( __( 'By %s' ), '{{ data.author }}' );
    354 		?>
    355 	</div>
    356 
    357 	<div class="theme-id-container">
    358 		<h3 class="theme-name">{{ data.name }}</h3>
    359 
    360 		<div class="theme-actions">
    361 			<# if ( data.installed ) { #>
    362 				<# if ( data.compatible_wp && data.compatible_php ) { #>
    363 					<?php
    364 					/* translators: %s: Theme name. */
    365 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    366 					?>
    367 					<# if ( data.activate_url ) { #>
    368 						<# if ( ! data.active ) { #>
    369 							<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
    370 						<# } else { #>
    371 							<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
    372 						<# } #>
    373 					<# } #>
    374 					<# if ( data.customize_url ) { #>
    375 						<# if ( ! data.active ) { #>
    376 							<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
    377 						<# } else { #>
    378 							<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
    379 						<# } #>
    380 					<# } else { #>
    381 						<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
    382 					<# } #>
    383 				<# } else { #>
    384 					<?php
    385 					/* translators: %s: Theme name. */
    386 					$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
    387 					?>
    388 					<# if ( data.activate_url ) { #>
    389 						<a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    390 					<# } #>
    391 					<# if ( data.customize_url ) { #>
    392 						<a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
    393 					<# } else { #>
    394 						<button class="button disabled"><?php _e( 'Preview' ); ?></button>
    395 					<# } #>
    396 				<# } #>
    397 			<# } else { #>
    398 				<# if ( data.compatible_wp && data.compatible_php ) { #>
    399 					<?php
    400 					/* translators: %s: Theme name. */
    401 					$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
    402 					?>
    403 					<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>
    404 					<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
    405 				<# } else { #>
    406 					<?php
    407 					/* translators: %s: Theme name. */
    408 					$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
    409 					?>
    410 					<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
    411 					<button class="button disabled"><?php _e( 'Preview' ); ?></button>
    412 				<# } #>
    413 			<# } #>
    414 		</div>
    415 	</div>
    416 </script>
    417 
    418 <script id="tmpl-theme-preview" type="text/template">
    419 	<div class="wp-full-overlay-sidebar">
    420 		<div class="wp-full-overlay-header">
    421 			<button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
    422 			<button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button>
    423 			<button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button>
    424 			<# if ( data.installed ) { #>
    425 				<# if ( data.compatible_wp && data.compatible_php ) { #>
    426 					<?php
    427 					/* translators: %s: Theme name. */
    428 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    429 					?>
    430 					<# if ( ! data.active ) { #>
    431 						<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
    432 					<# } else { #>
    433 						<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
    434 					<# } #>
    435 				<# } else { #>
    436 					<a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    437 				<# } #>
    438 			<# } else { #>
    439 				<# if ( data.compatible_wp && data.compatible_php ) { #>
    440 					<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
    441 				<# } else { #>
    442 					<a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
    443 				<# } #>
    444 			<# } #>
    445 		</div>
    446 		<div class="wp-full-overlay-sidebar-content">
    447 			<div class="install-theme-info">
    448 				<h3 class="theme-name">{{ data.name }}</h3>
    449 					<span class="theme-by">
    450 						<?php
    451 						/* translators: %s: Theme author name. */
    452 						printf( __( 'By %s' ), '{{ data.author }}' );
    453 						?>
    454 					</span>
    455 
    456 					<img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
    457 
    458 					<div class="theme-details">
    459 						<# if ( data.rating ) { #>
    460 							<div class="theme-rating">
    461 								{{{ data.stars }}}
    462 								<a class="num-ratings" href="{{ data.reviews_url }}">
    463 									<?php
    464 									/* translators: %s: Number of ratings. */
    465 									printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
    466 									?>
    467 								</a>
    468 							</div>
    469 						<# } else { #>
    470 							<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
    471 						<# } #>
    472 
    473 						<div class="theme-version">
    474 							<?php
    475 							/* translators: %s: Theme version. */
    476 							printf( __( 'Version: %s' ), '{{ data.version }}' );
    477 							?>
    478 						</div>
    479 
    480 						<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
    481 							<div class="notice notice-error notice-alt notice-large"><p>
    482 								<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
    483 									<?php
    484 									_e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
    485 									if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    486 										printf(
    487 											/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    488 											' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
    489 											self_admin_url( 'update-core.php' ),
    490 											esc_url( wp_get_update_php_url() )
    491 										);
    492 										wp_update_php_annotation( '</p><p><em>', '</em>' );
    493 									} elseif ( current_user_can( 'update_core' ) ) {
    494 										printf(
    495 											/* translators: %s: URL to WordPress Updates screen. */
    496 											' ' . __( '<a href="%s">Please update WordPress</a>.' ),
    497 											self_admin_url( 'update-core.php' )
    498 										);
    499 									} elseif ( current_user_can( 'update_php' ) ) {
    500 										printf(
    501 											/* translators: %s: URL to Update PHP page. */
    502 											' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
    503 											esc_url( wp_get_update_php_url() )
    504 										);
    505 										wp_update_php_annotation( '</p><p><em>', '</em>' );
    506 									}
    507 									?>
    508 								<# } else if ( ! data.compatible_wp ) { #>
    509 									<?php
    510 									_e( 'This theme doesn&#8217;t work with your version of WordPress.' );
    511 									if ( current_user_can( 'update_core' ) ) {
    512 										printf(
    513 											/* translators: %s: URL to WordPress Updates screen. */
    514 											' ' . __( '<a href="%s">Please update WordPress</a>.' ),
    515 											self_admin_url( 'update-core.php' )
    516 										);
    517 									}
    518 									?>
    519 								<# } else if ( ! data.compatible_php ) { #>
    520 									<?php
    521 									_e( 'This theme doesn&#8217;t work with your version of PHP.' );
    522 									if ( current_user_can( 'update_php' ) ) {
    523 										printf(
    524 											/* translators: %s: URL to Update PHP page. */
    525 											' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
    526 											esc_url( wp_get_update_php_url() )
    527 										);
    528 										wp_update_php_annotation( '</p><p><em>', '</em>' );
    529 									}
    530 									?>
    531 								<# } #>
    532 							</p></div>
    533 						<# } #>
    534 
    535 						<div class="theme-description">{{{ data.description }}}</div>
    536 					</div>
    537 				</div>
    538 			</div>
    539 			<div class="wp-full-overlay-footer">
    540 				<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
    541 					<span class="collapse-sidebar-arrow"></span>
    542 					<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
    543 				</button>
    544 			</div>
    545 		</div>
    546 		<div class="wp-full-overlay-main">
    547 		<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
    548 	</div>
    549 </script>
    550 
    551 <?php
    552 wp_print_request_filesystem_credentials_modal();
    553 wp_print_admin_notice_templates();
    554 
    555 require_once ABSPATH . 'wp-admin/admin-footer.php';