Ticket #18724: 18724_jk.patch

File 18724_jk.patch, 6.5 KB (added by johnkleinschmidt, 19 months ago)

Patch that doesn't break search

  • wp-admin/includes/plugin-install.php

     
    8686        <h4><?php _e('Search') ?></h4> 
    8787        <p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p> 
    8888        <?php install_search_form(); ?> 
    89  
     89        <br class="clear" /> 
    9090        <h4><?php _e('Popular tags') ?></h4> 
    9191        <p class="install-help"><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p> 
    9292        <?php 
     
    114114/** 
    115115 * Display search form for searching plugins. 
    116116 * 
     117 * @param object $list_table.  The WP_List_Table to use to generate pagination 
     118 * for the search form.  Defaults to null, meaning no pagination will be 
     119 * generated by default. 
     120 * 
    117121 * @since 2.7.0 
    118122 */ 
    119 function install_search_form(){ 
     123function install_search_form( $list_table = null ){ 
    120124        $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; 
    121125        $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; 
    122126 
    123127        ?><form id="search-plugins" method="get" action=""> 
    124128                <input type="hidden" name="tab" value="search" /> 
    125                 <select name="type" id="typeselector"> 
    126                         <option value="term"<?php selected('term', $type) ?>><?php _e('Term'); ?></option> 
    127                         <option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option> 
    128                         <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option> 
    129                 </select> 
    130                 <input type="text" name="s" value="<?php echo esc_attr($term) ?>" /> 
    131                 <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label> 
    132                 <?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?> 
     129                <div class="alignleft actions"> 
     130                        <select name="type" id="typeselector"> 
     131                                <option value="term"<?php selected('term', $type) ?>><?php _e('Term'); ?></option> 
     132                                <option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option> 
     133                                <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option> 
     134                        </select> 
     135                        <input type="text" name="s" value="<?php echo esc_attr($term) ?>" /> 
     136                        <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label> 
     137                        <?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?> 
     138                </div> 
     139                <?php 
     140                        if ( isset(     $list_table ) ) { 
     141                                $list_table->pagination( 'top' ); 
     142                        } 
     143                ?> 
    133144        </form><?php 
    134145} 
    135146 
  • wp-admin/includes/class-wp-plugin-install-list-table.php

     
    113113        function display_tablenav( $which ) { 
    114114                if ( 'top' ==  $which ) { ?> 
    115115                        <div class="tablenav top"> 
    116                                 <div class="alignleft actions"> 
    117                                         <?php do_action( 'install_plugins_table_header' ); ?> 
    118                                 </div> 
    119                                 <?php $this->pagination( $which ); ?> 
     116                                <?php do_action( 'install_plugins_table_header', $this ); ?> 
    120117                                <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" /> 
    121118                                <br class="clear" /> 
    122119                        </div> 
  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    130130 
    131131                // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
    132132?> 
    133                 <div class="tablenav top themes"> 
    134                         <div class="alignleft actions"> 
    135                                 <?php do_action( 'install_themes_table_header' ); ?> 
    136                         </div> 
    137                         <?php $this->pagination( 'top' ); ?> 
     133                <div class="tablenav top themes">                        
     134                        <?php do_action( 'install_themes_table_header', $this ); ?> 
    138135                        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" /> 
    139136                        <br class="clear" /> 
    140137                </div> 
  • wp-admin/includes/theme-install.php

     
    4747/** 
    4848 * Display search form for searching themes. 
    4949 * 
     50 * @param object $list_table.  The WP_List_Table to use to generate pagination 
     51 * for the search form.  Defaults to null, meaning no pagination will be 
     52 * generated by default. 
     53 *  
    5054 * @since 2.8.0 
    5155 */ 
    52 function install_theme_search_form() { 
     56function install_theme_search_form( $list_table = null ) { 
    5357        $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : ''; 
    5458        $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; 
    5559        ?> 
    5660<p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p> 
    57  
    5861<form id="search-themes" method="get" action=""> 
    5962        <input type="hidden" name="tab" value="search" /> 
    60         <select name="type" id="typeselector"> 
    61         <option value="term" <?php selected('term', $type) ?>><?php _e('Term'); ?></option> 
    62         <option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option> 
    63         <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option> 
    64         </select> 
    65         <input type="text" name="s" size="30" value="<?php echo esc_attr($term) ?>" /> 
    66         <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?> 
     63        <div class="alignleft actions"> 
     64                <select name="type" id="typeselector"> 
     65                <option value="term" <?php selected('term', $type) ?>><?php _e('Term'); ?></option> 
     66                <option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option> 
     67                <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option> 
     68                </select> 
     69                <input type="text" name="s" size="30" value="<?php echo esc_attr($term) ?>" /> 
     70                <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?> 
     71        </div> 
     72        <?php 
     73                if ( isset(     $list_table ) ) { 
     74                        $list_table->pagination( 'top' ); 
     75                } 
     76        ?> 
    6777</form> 
    6878<?php 
    6979} 
     
    7686function install_themes_dashboard() { 
    7787        install_theme_search_form(); 
    7888?> 
     89<br class="clear" /> 
    7990<h4><?php _e('Feature Filter') ?></h4> 
    8091<form method="post" action="<?php echo self_admin_url( 'theme-install.php?tab=search' ); ?>"> 
    8192<p class="install-help"><?php _e('Find a theme based on specific features') ?></p>