Wordpress 4.6
[autoinstalls/wordpress.git] / wp-admin / themes.php
1 <?php
2 /**
3  * Themes administration panel.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /** WordPress Administration Bootstrap */
10 require_once( dirname( __FILE__ ) . '/admin.php' );
11
12 if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
13         wp_die(
14                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
15                 '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
16                 403
17         );
18 }
19
20 if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
21         if ( 'activate' == $_GET['action'] ) {
22                 check_admin_referer('switch-theme_' . $_GET['stylesheet']);
23                 $theme = wp_get_theme( $_GET['stylesheet'] );
24
25                 if ( ! $theme->exists() || ! $theme->is_allowed() ) {
26                         wp_die(
27                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
28                                 '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
29                                 403
30                         );
31                 }
32
33                 switch_theme( $theme->get_stylesheet() );
34                 wp_redirect( admin_url('themes.php?activated=true') );
35                 exit;
36         } elseif ( 'delete' == $_GET['action'] ) {
37                 check_admin_referer('delete-theme_' . $_GET['stylesheet']);
38                 $theme = wp_get_theme( $_GET['stylesheet'] );
39
40                 if ( ! current_user_can( 'delete_themes' ) ) {
41                         wp_die(
42                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
43                                 '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
44                                 403
45                         );
46                 }
47
48                 if ( ! $theme->exists() ) {
49                         wp_die(
50                                 '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
51                                 '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
52                                 403
53                         );
54                 }
55
56                 $active = wp_get_theme();
57                 if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {
58                         wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );
59                 } else {
60                         delete_theme( $_GET['stylesheet'] );
61                         wp_redirect( admin_url( 'themes.php?deleted=true' ) );
62                 }
63                 exit;
64         }
65 }
66
67 $title = __('Manage Themes');
68 $parent_file = 'themes.php';
69
70 // Help tab: Overview
71 if ( current_user_can( 'switch_themes' ) ) {
72         $help_overview  = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' .
73                 '<p>' . __( 'From this screen you can:' ) . '</p>' .
74                 '<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' .
75                 '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' .
76                 '<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' .
77                 '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' .
78                 '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>';
79
80         get_current_screen()->add_help_tab( array(
81                 'id'      => 'overview',
82                 'title'   => __( 'Overview' ),
83                 'content' => $help_overview
84         ) );
85 } // switch_themes
86
87 // Help tab: Adding Themes
88 if ( current_user_can( 'install_themes' ) ) {
89         if ( is_multisite() ) {
90                 $help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>';
91         } else {
92                 $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">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!'), 'https://wordpress.org/themes/' ) . '</p>';
93         }
94
95         get_current_screen()->add_help_tab( array(
96                 'id'      => 'adding-themes',
97                 'title'   => __('Adding Themes'),
98                 'content' => $help_install
99         ) );
100 } // install_themes
101
102 // Help tab: Previewing and Customizing
103 if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
104         $help_customize =
105                 '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>'.
106                 '<p>' . __( 'The theme being previewed is fully interactive &mdash; navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Save &amp; Activate button above the menu.' ) . '</p>' .
107                 '<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>';
108
109         get_current_screen()->add_help_tab( array(
110                 'id'            => 'customize-preview-themes',
111                 'title'         => __( 'Previewing and Customizing' ),
112                 'content'       => $help_customize
113         ) );
114 } // edit_theme_options && customize
115
116 get_current_screen()->set_help_sidebar(
117         '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
118         '<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>' ) . '</p>' .
119         '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
120 );
121
122 if ( current_user_can( 'switch_themes' ) ) {
123         $themes = wp_prepare_themes_for_js();
124 } else {
125         $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) );
126 }
127 wp_reset_vars( array( 'theme', 'search' ) );
128
129 wp_localize_script( 'theme', '_wpThemeSettings', array(
130         'themes'   => $themes,
131         'settings' => array(
132                 'canInstall'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ),
133                 'installURI'    => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null,
134                 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
135                 'adminUrl'      => parse_url( admin_url(), PHP_URL_PATH ),
136         ),
137         'l10n' => array(
138                 'addNew'            => __( 'Add New Theme' ),
139                 'search'            => __( 'Search Installed Themes' ),
140                 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis)
141                 'themesFound'       => __( 'Number of Themes found: %d' ),
142                 'noThemesFound'     => __( 'No themes found. Try a different search.' ),
143         ),
144 ) );
145
146 add_thickbox();
147 wp_enqueue_script( 'theme' );
148 wp_enqueue_script( 'updates' );
149 wp_enqueue_script( 'customize-loader' );
150
151 require_once( ABSPATH . 'wp-admin/admin-header.php' );
152 ?>
153
154 <div class="wrap">
155         <h1><?php esc_html_e( 'Themes' ); ?>
156                 <span class="title-count theme-count"><?php echo count( $themes ); ?></span>
157         <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
158                 <a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a>
159         <?php endif; ?>
160         </h1>
161 <?php
162 if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?>
163 <div id="message1" class="updated notice is-dismissible"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
164 <?php elseif ( isset($_GET['activated']) ) :
165                 if ( isset( $_GET['previewed'] ) ) { ?>
166                 <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
167                 <?php } else { ?>
168 <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div><?php
169                 }
170         elseif ( isset($_GET['deleted']) ) : ?>
171 <div id="message3" class="updated notice is-dismissible"><p><?php _e('Theme deleted.') ?></p></div>
172 <?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?>
173         <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
174 <?php
175 endif;
176
177 $ct = wp_get_theme();
178
179 if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
180         echo '<div class="error"><p>' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '</p></div>';
181 }
182
183 /*
184 // Certain error codes are less fatal than others. We can still display theme information in most cases.
185 if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
186         && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>
187 */
188
189         // Pretend you didn't see this.
190         $current_theme_actions = array();
191         if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
192                 foreach ( (array) $submenu['themes.php'] as $item) {
193                         $class = '';
194                         if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 0 === strpos( $item[2], 'customize.php' ) )
195                                 continue;
196                         // 0 = name, 1 = capability, 2 = file
197                         if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
198                                 $class = ' current';
199                         if ( !empty($submenu[$item[2]]) ) {
200                                 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
201                                 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
202                                 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
203                                         $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
204                                 else
205                                         $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
206                         } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
207                                 $menu_file = $item[2];
208
209                                 if ( current_user_can( 'customize' ) ) {
210                                         if ( 'custom-header' === $menu_file ) {
211                                                 $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
212                                         } elseif ( 'custom-background' === $menu_file ) {
213                                                 $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
214                                         }
215                                 }
216
217                                 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
218                                         $menu_file = substr( $menu_file, 0, $pos );
219                                 }
220
221                                 if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
222                                         $current_theme_actions[] = "<a class='button button-secondary$class' href='{$item[2]}'>{$item[0]}</a>";
223                                 } else {
224                                         $current_theme_actions[] = "<a class='button button-secondary$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
225                                 }
226                         }
227                 }
228         }
229
230 ?>
231
232 <div class="theme-browser">
233         <div class="themes wp-clearfix">
234
235 <?php
236 /*
237  * This PHP is synchronized with the tmpl-theme template below!
238  */
239
240 foreach ( $themes as $theme ) :
241         $aria_action = esc_attr( $theme['id'] . '-action' );
242         $aria_name   = esc_attr( $theme['id'] . '-name' );
243         ?>
244 <div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
245         <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
246                 <div class="theme-screenshot">
247                         <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />
248                 </div>
249         <?php } else { ?>
250                 <div class="theme-screenshot blank"></div>
251         <?php } ?>
252
253         <?php if ( $theme['hasUpdate'] ) : ?>
254                 <div class="update-message notice inline notice-warning notice-alt">
255                         <p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
256                 </div>
257         <?php endif; ?>
258
259         <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
260         <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
261
262         <?php if ( $theme['active'] ) { ?>
263                 <h2 class="theme-name" id="<?php echo $aria_name; ?>">
264                         <?php
265                         /* translators: %s: theme name */
266                         printf( __( '<span>Active:</span> %s' ), $theme['name'] );
267                         ?>
268                 </h2>
269         <?php } else { ?>
270                 <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2>
271         <?php } ?>
272
273         <div class="theme-actions">
274
275         <?php if ( $theme['active'] ) { ?>
276                 <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
277                         <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
278                 <?php } ?>
279         <?php } else { ?>
280                 <?php
281                 /* translators: %s: Theme name */
282                 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
283                 ?>
284                 <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
285                 <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
286                         <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
287                 <?php } ?>
288         <?php } ?>
289
290         </div>
291 </div>
292 <?php endforeach; ?>
293         </div>
294 </div>
295 <div class="theme-overlay"></div>
296
297 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
298
299 <?php
300 // List broken themes, if any.
301 if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
302 ?>
303
304 <div class="broken-themes">
305 <h3><?php _e('Broken Themes'); ?></h3>
306 <p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
307
308 <?php
309 $can_delete = current_user_can( 'delete_themes' );
310 $can_install = current_user_can( 'install_themes' );
311 ?>
312 <table>
313         <tr>
314                 <th><?php _ex('Name', 'theme name'); ?></th>
315                 <th><?php _e('Description'); ?></th>
316                 <?php if ( $can_delete ) { ?>
317                         <td></td>
318                 <?php } ?>
319                 <?php if ( $can_install ) { ?>
320                         <td></td>
321                 <?php } ?>
322         </tr>
323         <?php foreach ( $broken_themes as $broken_theme ) : ?>
324                 <tr>
325                         <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
326                         <td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
327                         <?php
328                         if ( $can_delete ) {
329                                 $stylesheet = $broken_theme->get_stylesheet();
330                                 $delete_url = add_query_arg( array(
331                                         'action'     => 'delete',
332                                         'stylesheet' => urlencode( $stylesheet ),
333                                 ), admin_url( 'themes.php' ) );
334                                 $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
335                                 ?>
336                                 <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a></td>
337                                 <?php
338                         }
339
340                         if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {
341                                 $parent_theme_name = $broken_theme->get( 'Template' );
342                                 $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );
343
344                                 if ( ! is_wp_error( $parent_theme ) ) {
345                                         $install_url = add_query_arg( array(
346                                                 'action' => 'install-theme',
347                                                 'theme'  => urlencode( $parent_theme_name ),
348                                         ), admin_url( 'update.php' ) );
349                                         $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
350                                         ?>
351                                         <td><a href="<?php echo esc_url( $install_url ); ?>" class="button button-secondary install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
352                                         <?php
353                                 }
354                         }
355                         ?>
356                 </tr>
357         <?php endforeach; ?>
358 </table>
359 </div>
360
361 <?php
362 }
363 ?>
364 </div><!-- .wrap -->
365
366 <?php
367 /*
368  * The tmpl-theme template is synchronized with PHP above!
369  */
370 ?>
371 <script id="tmpl-theme" type="text/template">
372         <# if ( data.screenshot[0] ) { #>
373                 <div class="theme-screenshot">
374                         <img src="{{ data.screenshot[0] }}" alt="" />
375                 </div>
376         <# } else { #>
377                 <div class="theme-screenshot blank"></div>
378         <# } #>
379
380         <# if ( data.hasUpdate ) { #>
381                 <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
382         <# } #>
383
384         <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
385         <div class="theme-author">
386                 <?php
387                 /* translators: %s: Theme author name */
388                 printf( __( 'By %s' ), '{{{ data.author }}}' );
389                 ?>
390         </div>
391
392         <# if ( data.active ) { #>
393                 <h2 class="theme-name" id="{{ data.id }}-name">
394                         <?php
395                         /* translators: %s: Theme name */
396                         printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' );
397                         ?>
398                 </h2>
399         <# } else { #>
400                 <h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2>
401         <# } #>
402
403         <div class="theme-actions">
404                 <# if ( data.active ) { #>
405                         <# if ( data.actions.customize ) { #>
406                                 <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
407                         <# } #>
408                 <# } else { #>
409                         <?php
410                         /* translators: %s: Theme name */
411                         $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
412                         ?>
413                         <a class="button button-secondary activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
414                         <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
415                 <# } #>
416         </div>
417 </script>
418
419 <script id="tmpl-theme-single" type="text/template">
420         <div class="theme-backdrop"></div>
421         <div class="theme-wrap wp-clearfix">
422                 <div class="theme-header">
423                         <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
424                         <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
425                         <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button>
426                 </div>
427                 <div class="theme-about wp-clearfix">
428                         <div class="theme-screenshots">
429                         <# if ( data.screenshot[0] ) { #>
430                                 <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
431                         <# } else { #>
432                                 <div class="screenshot blank"></div>
433                         <# } #>
434                         </div>
435
436                         <div class="theme-info">
437                                 <# if ( data.active ) { #>
438                                         <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
439                                 <# } #>
440                                 <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
441                                 <p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p>
442
443                                 <# if ( data.hasUpdate ) { #>
444                                 <div class="notice notice-warning notice-alt notice-large">
445                                         <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
446                                         {{{ data.update }}}
447                                 </div>
448                                 <# } #>
449                                 <p class="theme-description">{{{ data.description }}}</p>
450
451                                 <# if ( data.parent ) { #>
452                                         <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
453                                 <# } #>
454
455                                 <# if ( data.tags ) { #>
456                                         <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>
457                                 <# } #>
458                         </div>
459                 </div>
460
461                 <div class="theme-actions">
462                         <div class="active-theme">
463                                 <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a>
464                                 <?php echo implode( ' ', $current_theme_actions ); ?>
465                         </div>
466                         <div class="inactive-theme">
467                                 <?php
468                                 /* translators: %s: Theme name */
469                                 $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
470                                 ?>
471                                 <# if ( data.actions.activate ) { #>
472                                         <a href="{{{ data.actions.activate }}}" class="button button-secondary activate" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
473                                 <# } #>
474                                 <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
475                         </div>
476
477                         <# if ( ! data.active && data.actions['delete'] ) { #>
478                                 <a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a>
479                         <# } #>
480                 </div>
481         </div>
482 </script>
483
484 <?php
485 wp_print_request_filesystem_credentials_modal();
486 wp_print_admin_notice_templates();
487 wp_print_update_row_templates();
488
489 require( ABSPATH . 'wp-admin/admin-footer.php' );