wp/wp-admin/themes.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    22 		check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] );
    22 		check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] );
    23 		$theme = wp_get_theme( $_GET['stylesheet'] );
    23 		$theme = wp_get_theme( $_GET['stylesheet'] );
    24 
    24 
    25 		if ( ! $theme->exists() || ! $theme->is_allowed() ) {
    25 		if ( ! $theme->exists() || ! $theme->is_allowed() ) {
    26 			wp_die(
    26 			wp_die(
    27 				'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
    27 				'<h1>' . __( 'An error occurred.' ) . '</h1>' .
    28 				'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    28 				'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    29 				403
    29 				403
    30 			);
    30 			);
    31 		}
    31 		}
    32 
    32 
    65 			);
    65 			);
    66 		}
    66 		}
    67 
    67 
    68 		if ( ! $theme->exists() ) {
    68 		if ( ! $theme->exists() ) {
    69 			wp_die(
    69 			wp_die(
    70 				'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
    70 				'<h1>' . __( 'An error occurred while deleting the theme.' ) . '</h1>' .
    71 				'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    71 				'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
    72 				403
    72 				403
    73 			);
    73 			);
    74 		}
    74 		}
    75 
    75 
   151 	if ( is_multisite() ) {
   151 	if ( is_multisite() ) {
   152 		$help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';
   152 		$help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';
   153 	} else {
   153 	} else {
   154 		$help_install = '<p>' . sprintf(
   154 		$help_install = '<p>' . sprintf(
   155 			/* translators: %s: https://wordpress.org/themes/ */
   155 			/* translators: %s: https://wordpress.org/themes/ */
   156 			__( 'If you would like to see more themes to choose from, click on the &#8220;Add New Theme&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
   156 			__( 'If you would like to see more themes to choose from, click on the &#8220;Add Theme&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ),
   157 			__( 'https://wordpress.org/themes/' )
   157 			__( 'https://wordpress.org/themes/' )
   158 		) . '</p>';
   158 		) . '</p>';
   159 	}
   159 	}
   160 
   160 
   161 	get_current_screen()->add_help_tab(
   161 	get_current_screen()->add_help_tab(
   229 			'installURI'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,
   229 			'installURI'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,
   230 			'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
   230 			'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
   231 			'adminUrl'      => parse_url( admin_url(), PHP_URL_PATH ),
   231 			'adminUrl'      => parse_url( admin_url(), PHP_URL_PATH ),
   232 		),
   232 		),
   233 		'l10n'     => array(
   233 		'l10n'     => array(
   234 			'addNew'        => __( 'Add New Theme' ),
   234 			'addNew'        => __( 'Add Theme' ),
   235 			'search'        => __( 'Search installed themes' ),
   235 			'search'        => __( 'Search installed themes' ),
   236 			/* translators: %d: Number of themes. */
   236 			/* translators: %d: Number of themes. */
   237 			'themesFound'   => __( 'Number of Themes found: %d' ),
   237 			'themesFound'   => __( 'Number of Themes found: %d' ),
   238 			'noThemesFound' => __( 'No themes found. Try a different search.' ),
   238 			'noThemesFound' => __( 'No themes found. Try a different search.' ),
   239 		),
   239 		),
   250 <div class="wrap">
   250 <div class="wrap">
   251 	<h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?>
   251 	<h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?>
   252 		<span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '&hellip;' ) : count( $themes ); ?></span>
   252 		<span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '&hellip;' ) : count( $themes ); ?></span>
   253 	</h1>
   253 	</h1>
   254 	<?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
   254 	<?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
   255 		<a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html__( 'Add New Theme' ); ?></a>
   255 		<a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html__( 'Add Theme' ); ?></a>
   256 	<?php endif; ?>
   256 	<?php endif; ?>
   257 	<hr class="wp-header-end">
   257 	<hr class="wp-header-end">
   258 	<form class="search-form search-themes"><p class="search-box"></p></form>
   258 	<form class="search-form search-themes"><p class="search-box"></p></form>
   259 
   259 
   260 <?php
   260 <?php
   343 
   343 
   344 $current_theme = wp_get_theme();
   344 $current_theme = wp_get_theme();
   345 
   345 
   346 if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
   346 if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
   347 	wp_admin_notice(
   347 	wp_admin_notice(
   348 		__( 'Error:' ) . ' ' . $current_theme->errors()->get_error_message(),
   348 		'<strong>' . __( 'Error:' ) . '</strong> ' . $current_theme->errors()->get_error_message(),
   349 		array(
   349 		array(
   350 			'additional_classes' => array( 'error' ),
   350 			'additional_classes' => array( 'error' ),
   351 		)
   351 		)
   352 	);
   352 	);
   353 }
   353 }
   581 	}
   581 	}
   582 
   582 
   583 	/* translators: %s: Theme name. */
   583 	/* translators: %s: Theme name. */
   584 	$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] );
   584 	$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] );
   585 	?>
   585 	?>
   586 	<button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>"><?php _e( 'Theme Details' ); ?></button>
   586 	<button type="button" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>"
       
   587 		aria-label="<?php echo esc_attr( $details_aria_label ); ?>"
       
   588 	><?php _e( 'Theme Details' ); ?></button>
   587 	<div class="theme-author">
   589 	<div class="theme-author">
   588 		<?php
   590 		<?php
   589 		/* translators: %s: Theme author name. */
   591 		/* translators: %s: Theme author name. */
   590 		printf( __( 'By %s' ), $theme['author'] );
   592 		printf( __( 'By %s' ), $theme['author'] );
   591 		?>
   593 		?>
   605 			<?php
   607 			<?php
   606 			if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
   608 			if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
   607 				/* translators: %s: Theme name. */
   609 				/* translators: %s: Theme name. */
   608 				$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] );
   610 				$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] );
   609 				?>
   611 				?>
   610 				<a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
   612 				<a class="button button-primary customize load-customize hide-if-no-customize"
       
   613 					href="<?php echo esc_url( $theme['actions']['customize'] ); ?>"
       
   614 					aria-label="<?php echo esc_attr( $customize_aria_label ); ?>"
       
   615 				><?php _e( 'Customize' ); ?></a>
   611 			<?php } ?>
   616 			<?php } ?>
   612 		<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?>
   617 		<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?>
   613 			<?php
   618 			<?php
   614 			/* translators: %s: Theme name. */
   619 			/* translators: %s: Theme name. */
   615 			$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
   620 			$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
   616 			?>
   621 			?>
   617 			<a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
   622 			<a class="button activate"
       
   623 				href="<?php echo esc_url( $theme['actions']['activate'] ); ?>"
       
   624 				aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
   625 			><?php _e( 'Activate' ); ?></a>
       
   626 
   618 			<?php
   627 			<?php
   619 			// Only classic themes require the "customize" capability.
   628 			// Only classic themes require the "customize" capability.
   620 			if ( current_user_can( 'edit_theme_options' ) && ( $theme['blockTheme'] || current_user_can( 'customize' ) ) ) {
   629 			if ( current_user_can( 'edit_theme_options' ) && ( $theme['blockTheme'] || current_user_can( 'customize' ) ) ) {
   621 				/* translators: %s: Theme name. */
   630 				/* translators: %s: Theme name. */
   622 				$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
   631 				$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
   623 				?>
   632 				?>
   624 				<a aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
   633 				<a class="button button-primary load-customize hide-if-no-customize"
       
   634 					href="<?php echo esc_url( $theme['actions']['customize'] ); ?>"
       
   635 					aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
       
   636 				><?php _e( 'Live Preview' ); ?></a>
   625 			<?php } ?>
   637 			<?php } ?>
   626 		<?php } else { ?>
   638 		<?php } else { ?>
   627 			<?php
   639 			<?php
   628 			/* translators: %s: Theme name. */
   640 			/* translators: %s: Theme name. */
   629 			$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
   641 			$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
   630 			?>
   642 			?>
   631 			<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
   643 			<a class="button disabled"
   632 			<?php if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
   644 				aria-label="<?php echo esc_attr( $aria_label ); ?>"
   633 				<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
   645 			><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
       
   646 
       
   647 			<?php
       
   648 			if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
       
   649 				/* translators: %s: Theme name. */
       
   650 				$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
       
   651 				?>
       
   652 				<a class="button button-primary hide-if-no-customize disabled"
       
   653 					aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
       
   654 				><?php _e( 'Live Preview' ); ?></a>
   634 			<?php } ?>
   655 			<?php } ?>
   635 		<?php } ?>
   656 		<?php } ?>
   636 
   657 
   637 		</div>
   658 		</div>
   638 	</div>
   659 	</div>
   952 
   973 
   953 	<?php
   974 	<?php
   954 	/* translators: %s: Theme name. */
   975 	/* translators: %s: Theme name. */
   955 	$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' );
   976 	$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' );
   956 	?>
   977 	?>
   957 	<button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></button>
   978 	<button type="button" class="more-details" id="{{ data.id }}-action"
       
   979 		aria-label="<?php echo esc_attr( $details_aria_label ); ?>"
       
   980 	><?php _e( 'Theme Details' ); ?></button>
   958 	<div class="theme-author">
   981 	<div class="theme-author">
   959 		<?php
   982 		<?php
   960 		/* translators: %s: Theme author name. */
   983 		/* translators: %s: Theme author name. */
   961 		printf( __( 'By %s' ), '{{{ data.author }}}' );
   984 		printf( __( 'By %s' ), '{{{ data.author }}}' );
   962 		?>
   985 		?>
   976 				<# if ( data.actions.customize ) { #>
   999 				<# if ( data.actions.customize ) { #>
   977 					<?php
  1000 					<?php
   978 					/* translators: %s: Theme name. */
  1001 					/* translators: %s: Theme name. */
   979 					$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' );
  1002 					$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' );
   980 					?>
  1003 					?>
   981 					<a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
  1004 					<a class="button button-primary customize load-customize hide-if-no-customize"
       
  1005 						href="{{{ data.actions.customize }}}"
       
  1006 						aria-label="<?php echo esc_attr( $customize_aria_label ); ?>"
       
  1007 					><?php _e( 'Customize' ); ?></a>
   982 				<# } #>
  1008 				<# } #>
   983 			<# } else { #>
  1009 			<# } else { #>
   984 				<# if ( data.compatibleWP && data.compatiblePHP ) { #>
  1010 				<# if ( data.compatibleWP && data.compatiblePHP ) { #>
   985 					<?php
  1011 					<?php
   986 					/* translators: %s: Theme name. */
  1012 					/* translators: %s: Theme name. */
   987 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
  1013 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
   988 					?>
  1014 					?>
   989 					<a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
  1015 					<a class="button activate"
       
  1016 						href="{{{ data.actions.activate }}}"
       
  1017 						aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
  1018 					><?php _e( 'Activate' ); ?></a>
       
  1019 
   990 					<?php
  1020 					<?php
   991 					/* translators: %s: Theme name. */
  1021 					/* translators: %s: Theme name. */
   992 					$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
  1022 					$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
   993 					?>
  1023 					?>
   994 					<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>
  1024 					<a class="button button-primary load-customize hide-if-no-customize"
       
  1025 						href="{{{ data.actions.customize }}}"
       
  1026 						aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
       
  1027 					><?php _e( 'Live Preview' ); ?></a>
   995 				<# } else { #>
  1028 				<# } else { #>
   996 					<?php
  1029 					<?php
   997 					/* translators: %s: Theme name. */
  1030 					/* translators: %s: Theme name. */
   998 					$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
  1031 					$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
   999 					?>
  1032 					?>
  1000 					<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
  1033 					<a class="button disabled"
       
  1034 						aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
  1035 					><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
       
  1036 
  1001 					<# if ( ! data.blockTheme ) { #>
  1037 					<# if ( ! data.blockTheme ) { #>
  1002 						<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
  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>
  1003 					<# } #>
  1045 					<# } #>
  1004 				<# } #>
  1046 				<# } #>
  1005 			<# } #>
  1047 			<# } #>
  1006 		</div>
  1048 		</div>
  1007 	</div>
  1049 	</div>
  1209 			</div>
  1251 			</div>
  1210 		</div>
  1252 		</div>
  1211 
  1253 
  1212 		<div class="theme-actions">
  1254 		<div class="theme-actions">
  1213 			<div class="active-theme">
  1255 			<div class="active-theme">
  1214 				<a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a>
  1256 				<a class="button button-primary customize load-customize hide-if-no-customize"
       
  1257 					href="{{{ data.actions.customize }}}"
       
  1258 				><?php _e( 'Customize' ); ?></a>
  1215 				<?php echo implode( ' ', $current_theme_actions ); ?>
  1259 				<?php echo implode( ' ', $current_theme_actions ); ?>
  1216 			</div>
  1260 			</div>
       
  1261 
  1217 			<div class="inactive-theme">
  1262 			<div class="inactive-theme">
  1218 				<# if ( data.compatibleWP && data.compatiblePHP ) { #>
  1263 				<# if ( data.compatibleWP && data.compatiblePHP ) { #>
  1219 					<?php
       
  1220 					/* translators: %s: Theme name. */
       
  1221 					$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
       
  1222 					?>
       
  1223 					<# if ( ! data.blockTheme ) { #>
  1264 					<# if ( ! data.blockTheme ) { #>
  1224 						<a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
  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>
  1225 					<# } #>
  1273 					<# } #>
       
  1274 
  1226 					<# if ( data.actions.activate ) { #>
  1275 					<# if ( data.actions.activate ) { #>
  1227 						<a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
  1276 						<?php
       
  1277 						/* translators: %s: Theme name. */
       
  1278 						$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
       
  1279 						?>
       
  1280 						<a class="button activate"
       
  1281 							href="{{{ data.actions.activate }}}"
       
  1282 							aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
  1283 						><?php _e( 'Activate' ); ?></a>
  1228 					<# } #>
  1284 					<# } #>
  1229 				<# } else { #>
  1285 				<# } else { #>
  1230 					<?php
       
  1231 					/* translators: %s: Theme name. */
       
  1232 					$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
       
  1233 					?>
       
  1234 					<# if ( ! data.blockTheme ) { #>
  1286 					<# if ( ! data.blockTheme ) { #>
  1235 						<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
  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>
  1236 					<# } #>
  1294 					<# } #>
       
  1295 
  1237 					<# if ( data.actions.activate ) { #>
  1296 					<# if ( data.actions.activate ) { #>
  1238 						<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
  1297 						<?php
       
  1298 						/* translators: %s: Theme name. */
       
  1299 						$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
       
  1300 						?>
       
  1301 						<a class="button disabled"
       
  1302 							aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
  1303 						><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
  1239 					<# } #>
  1304 					<# } #>
  1240 				<# } #>
  1305 				<# } #>
  1241 			</div>
  1306 			</div>
  1242 
  1307 
  1243 			<# if ( ! data.active && data.actions['delete'] ) { #>
  1308 			<# if ( ! data.active && data.actions['delete'] ) { #>
  1244 				<?php
  1309 				<?php
  1245 				/* translators: %s: Theme name. */
  1310 				/* translators: %s: Theme name. */
  1246 				$aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' );
  1311 				$aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' );
  1247 				?>
  1312 				?>
  1248 				<a href="{{{ data.actions['delete'] }}}" class="button delete-theme" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Delete' ); ?></a>
  1313 				<a class="button delete-theme"
       
  1314 					href="{{{ data.actions['delete'] }}}"
       
  1315 					aria-label="<?php echo esc_attr( $aria_label ); ?>"
       
  1316 				><?php _e( 'Delete' ); ?></a>
  1249 			<# } #>
  1317 			<# } #>
  1250 		</div>
  1318 		</div>
  1251 	</div>
  1319 	</div>
  1252 </script>
  1320 </script>
  1253 
  1321