Reinstate 'install_themes_tabs' filter.

props ghost1227.
fixes #28578.
Built from https://develop.svn.wordpress.org/trunk@29002


git-svn-id: http://core.svn.wordpress.org/trunk@28790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-07-04 23:58:15 +00:00
parent 6827624501
commit 4b7a9edd27
2 changed files with 19 additions and 10 deletions

View File

@ -48,14 +48,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item. $nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
/** /** This filter is documented in wp-admin/theme-install.php */
* Filter the tabs shown on the Install Themes screen.
*
* @since 2.8.0
*
* @param array $tabs The tabs shown on the Install Themes screen. Defaults are
* 'dashboard', 'search', 'upload', 'featured', 'new', and 'updated'.
*/
$tabs = apply_filters( 'install_themes_tabs', $tabs ); $tabs = apply_filters( 'install_themes_tabs', $tabs );
/** /**

View File

@ -27,6 +27,11 @@ if ( ! is_network_admin() ) {
$submenu_file = 'themes.php'; $submenu_file = 'themes.php';
} }
$tabs = array(
'upload' => __( 'Upload Theme' ),
'browse-themes' => _x( 'Browse', 'themes' ),
);
$sections = array( $sections = array(
'featured' => __( 'Featured Themes' ), 'featured' => __( 'Featured Themes' ),
'popular' => __( 'Popular Themes' ), 'popular' => __( 'Popular Themes' ),
@ -110,8 +115,19 @@ include(ABSPATH . 'wp-admin/admin-header.php');
<div class="wrap"> <div class="wrap">
<h2> <h2>
<?php echo esc_html( $title ); ?> <?php echo esc_html( $title ); ?>
<a href="#" class="upload add-new-h2"><?php _e( 'Upload Theme' ); ?></a> <?php
<a href="#" class="browse-themes add-new-h2"><?php _ex( 'Browse', 'themes' ); ?></a> /**
* Filter the tabs shown on the Install Themes screen.
*
* @since 2.8.0
* @param array $tabs The tabs shown on the Install Themes screen. Defaults are
* 'upload' and 'browse-themes'.
*/
$tabs = apply_filters( 'install_themes_tabs', $tabs );
foreach ( $tabs as $tab_slug => $tab_name ) {
echo '<a href="#" class="' . esc_attr( $tab_slug ) . ' add-new-h2">' . $tab_name . '</a>';
}
?>
</h2> </h2>
<div class="upload-theme"> <div class="upload-theme">