Make WordPress Core

Changeset 20592


Ignore:
Timestamp:
04/25/2012 07:37:19 PM (13 years ago)
Author:
nacin
Message:

Reduce clutter and repetive functionality from the initial landing page for installing plugins and themes by removing the tag/author/term dropdown.

The tag cloud (plugins) and feature filter (themes) is sufficient for tag functionality. All three "search by" fields are already weighted for a standard keyword search through the WP.org API.

fixes #19619 for 3.4.

Location:
trunk/wp-admin/includes
Files:
4 edited

Legend:

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

    r19712 r20592  
    6363                }
    6464
    65                 add_action( 'install_plugins_table_header', 'install_search_form' );
     65                add_action( 'install_plugins_table_header', 'install_search_form', 10, 0 );
    6666                break;
    6767
  • trunk/wp-admin/includes/class-wp-theme-install-list-table.php

    r20414 r20592  
    7979                }
    8080
    81                 add_action( 'install_themes_table_header', 'install_theme_search_form' );
     81                add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
    8282                break;
    8383
  • trunk/wp-admin/includes/plugin-install.php

    r20490 r20592  
    8585
    8686    <h4><?php _e('Search') ?></h4>
    87     <p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p>
    88     <?php install_search_form(); ?>
     87    <?php install_search_form( false ); ?>
    8988
    9089    <h4><?php _e('Popular tags') ?></h4>
     
    117116 * @since 2.7.0
    118117 */
    119 function install_search_form(){
     118function install_search_form( $type_selector = true ) {
    120119    $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
    121120    $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
     
    123122    ?><form id="search-plugins" method="get" action="">
    124123        <input type="hidden" name="tab" value="search" />
     124        <?php if ( $type_selector ) : ?>
    125125        <select name="type" id="typeselector">
    126126            <option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
     
    128128            <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option>
    129129        </select>
     130        <?php endif; ?>
    130131        <input type="search" name="s" value="<?php echo esc_attr($term) ?>" />
    131132        <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
  • trunk/wp-admin/includes/theme-install.php

    r20333 r20592  
    5050 * @since 2.8.0
    5151 */
    52 function install_theme_search_form() {
     52function install_theme_search_form( $type_selector = true ) {
    5353    $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
    5454    $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
     55    if ( ! $type_selector )
     56        echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
    5557    ?>
    56 <p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p>
    57 
    5858<form id="search-themes" method="get" action="">
    5959    <input type="hidden" name="tab" value="search" />
     60    <?php if ( $type_selector ) : ?>
    6061    <select name="type" id="typeselector">
    6162    <option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
     
    6364    <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    6465    </select>
     66    <?php endif; ?>
    6567    <input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
    6668    <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
     
    7577 */
    7678function install_themes_dashboard() {
    77     install_theme_search_form();
     79    install_theme_search_form( false );
    7880?>
    7981<h4><?php _e('Feature Filter') ?></h4>
    80 <p class="install-help"><?php _e('Find a theme based on specific features') ?></p>
     82<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
    8183
    8284<form method="get" action="">
Note: See TracChangeset for help on using the changeset viewer.