Make WordPress Core

Changeset 29002


Ignore:
Timestamp:
07/04/2014 11:57:39 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Reinstate 'install_themes_tabs' filter.

props ghost1227.
fixes #28578.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r28633 r29002  
    4949                $nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
    5050
    51                 /**
    52                  * Filter the tabs shown on the Install Themes screen.
    53                  *
    54                  * @since 2.8.0
    55                  *
    56                  * @param array $tabs The tabs shown on the Install Themes screen. Defaults are
    57                  *                    'dashboard', 'search', 'upload', 'featured', 'new', and 'updated'.
    58                  */
     51                /** This filter is documented in wp-admin/theme-install.php */
    5952                $tabs = apply_filters( 'install_themes_tabs', $tabs );
    6053
  • trunk/src/wp-admin/theme-install.php

    r28473 r29002  
    2727        $submenu_file = 'themes.php';
    2828}
     29
     30$tabs = array(
     31        'upload'        => __( 'Upload Theme' ),
     32        'browse-themes' => _x( 'Browse', 'themes' ),
     33);
    2934
    3035$sections = array(
     
    111116        <h2>
    112117                <?php echo esc_html( $title ); ?>
    113                 <a href="#" class="upload add-new-h2"><?php _e( 'Upload Theme' ); ?></a>
    114                 <a href="#" class="browse-themes add-new-h2"><?php _ex( 'Browse', 'themes' ); ?></a>
     118                <?php
     119                /**
     120                 * Filter the tabs shown on the Install Themes screen.
     121                 *
     122                 * @since 2.8.0
     123                 * @param array $tabs The tabs shown on the Install Themes screen. Defaults are
     124                 *                    'upload' and 'browse-themes'.
     125                 */
     126                $tabs = apply_filters( 'install_themes_tabs', $tabs );
     127                foreach ( $tabs as $tab_slug => $tab_name ) {
     128                        echo '<a href="#" class="' . esc_attr( $tab_slug ) . ' add-new-h2">' . $tab_name . '</a>';
     129                }
     130                ?>
    115131        </h2>
    116132
Note: See TracChangeset for help on using the changeset viewer.