3 * Install theme administration panel.
6 * @subpackage Administration
9 /** WordPress Administration Bootstrap */
10 require_once('admin.php');
12 if ( ! current_user_can('install_themes') )
13 wp_die(__('You do not have sufficient permissions to install themes on this blog.'));
15 include(ABSPATH . 'wp-admin/includes/theme-install.php');
17 $title = __('Install Themes');
18 $parent_file = 'themes.php';
20 wp_reset_vars( array('tab', 'paged') );
21 wp_enqueue_style( 'theme-install' );
22 wp_enqueue_script( 'theme-install' );
25 wp_enqueue_script( 'theme-preview' );
27 //These are the tabs which are shown on the page,
29 $tabs['dashboard'] = __('Search');
30 if ( 'search' == $tab )
31 $tabs['search'] = __('Search Results');
32 $tabs['upload'] = __('Upload');
33 $tabs['featured'] = __('Featured');
34 //$tabs['popular'] = __('Popular');
35 $tabs['new'] = __('Newest');
36 $tabs['updated'] = __('Recently Updated');
38 $nonmenu_tabs = array('theme-information'); //Valid actions to perform which do not have a Menu item.
40 $tabs = apply_filters('install_themes_tabs', $tabs );
41 $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs);
43 //If a non-valid menu tab has been selected, And its not a non-menu action.
44 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
45 $tab_actions = array_keys($tabs);
46 $tab = $tab_actions[0];
53 do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
55 include('admin-header.php');
58 <?php screen_icon(); ?>
59 <h2><?php echo esc_html( $title ); ?></h2>
61 <ul class="subsubsub">
63 $display_tabs = array();
64 foreach ( (array)$tabs as $action => $text ) {
65 $sep = ( end($tabs) != $text ) ? ' | ' : '';
66 $class = ( $action == $tab ) ? ' class="current"' : '';
67 $href = admin_url('theme-install.php?tab='. $action);
68 echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n";
73 <?php do_action('install_themes_' . $tab, $paged); ?>
76 include('admin-footer.php');