Ticket #15353: search_box.15353.diff

File search_box.15353.diff, 11.5 KB (added by scribu, 2 years ago)
  • wp-admin/users.php

     
    357357 
    358358<form action="" method="post"> 
    359359 
    360 <?php if ( $wp_list_table->has_items() ) : ?> 
     360<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> 
    361361 
    362 <p class="search-box"> 
    363         <label class="screen-reader-text" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label> 
    364         <input type="text" id="user-search-input" name="s" value="<?php echo esc_attr($usersearch); ?>" /> 
    365         <?php submit_button( __( 'Search Users' ), 'button', 'submit', false ); ?> 
    366 </p> 
    367  
    368 <?php endif; ?> 
    369  
    370362<?php $wp_list_table->display(); ?> 
    371363</form> 
    372364 
  • wp-admin/edit-comments.php

     
    220220 
    221221<form id="comments-form" action="" method="post"> 
    222222 
    223 <?php if ( $wp_list_table->has_items() ) : ?> 
     223<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?> 
    224224 
    225 <p class="search-box"> 
    226         <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label> 
    227         <input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    228         <?php submit_button( __( 'Search Comments' ), 'button', 'submit', false ); ?> 
    229 </p> 
    230  
    231 <?php endif; ?> 
    232  
    233225<?php if ( $post_id ) : ?> 
    234226<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" /> 
    235227<?php endif; ?> 
  • wp-admin/includes/class-wp-list-table.php

     
    179179        } 
    180180 
    181181        /** 
     182         * Display the search box. 
     183         * 
     184         * @since 3.1.0 
     185         * @access public 
     186         * 
     187         * @param string $text The search button text 
     188         * @param string $input_id The search input id  
     189         */ 
     190        function search_box( $text, $input_id ) { 
     191                if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) 
     192                        return; 
     193 
     194                $input_id = $input_id . '-search-input'; 
     195 
     196?> 
     197<p class="search-box"> 
     198        <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> 
     199        <input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" /> 
     200        <?php submit_button( $text, 'button', 'submit', false ); ?> 
     201</p> 
     202<?php 
     203        } 
     204 
     205        /** 
    182206         * Get an associative array ( id => link ) with the list 
    183207         * of views available on this table. 
    184208         * 
  • wp-admin/edit-tags.php

     
    237237<form class="search-form" action="" method="get"> 
    238238<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 
    239239<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 
    240 <p class="search-box"> 
    241         <label class="screen-reader-text" for="tag-search-input"><?php echo $tax->labels->search_items; ?>:</label> 
    242         <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    243         <?php submit_button( $tax->labels->search_items, 'button', 'search-items', false ); ?> 
    244 </p> 
     240 
     241<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?> 
     242 
    245243</form> 
    246244<br class="clear" /> 
    247245 
  • wp-admin/upload.php

     
    206206 
    207207<form id="posts-filter" action="" method="post"> 
    208208 
    209 <?php if ( $wp_list_table->has_items() ) : ?> 
     209<?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?> 
    210210 
    211 <p class="search-box"> 
    212         <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media' ); ?>:</label> 
    213         <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" /> 
    214         <?php submit_button( __( 'Search Media' ), 'button', 'submit', false ); ?> 
    215 </p> 
    216  
    217 <?php endif; ?> 
    218  
    219211<?php $wp_list_table->display(); ?> 
    220212 
    221213<div id="ajax-response"></div> 
  • wp-admin/network/users.php

     
    7979        <?php $wp_list_table->views(); ?> 
    8080 
    8181        <form action="" method="get" class="search-form"> 
    82                 <p class="search-box"> 
    83                 <input type="text" name="s" value="<?php echo esc_attr( $usersearch ); ?>" class="search-input" id="user-search-input" /> 
    84                 <?php submit_button( __( 'Search Users' ), 'button', 'post-query-submit', false ); ?> 
    85                 </p> 
     82                <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> 
    8683        </form> 
    8784 
    8885        <form id="form-user-list" action='edit.php?action=allusers' method='post'> 
     
    9087        </form> 
    9188</div> 
    9289 
    93 <?php require_once( '../admin-footer.php' ); ?> 
    94  No newline at end of file 
     90<?php require_once( '../admin-footer.php' ); ?> 
  • wp-admin/network/site-users.php

     
    211211endif; ?> 
    212212 
    213213<form class="search-form" action="" method="get"> 
    214 <p class="search-box"> 
    215         <label class="screen-reader-text" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label> 
    216         <input type="text" id="user-search-input" name="s" value="<?php echo esc_attr($usersearch); ?>" /> 
    217         <?php submit_button( __( 'Search Users' ), 'button', 'submit', false ); ?> 
    218 </p> 
     214<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?> 
    219215</form> 
    220216 
    221217<?php $wp_list_table->views(); ?> 
     
    301297<?php endif; ?> 
    302298</div> 
    303299<?php 
    304 require('../admin-footer.php'); 
    305  No newline at end of file 
     300require('../admin-footer.php'); 
  • wp-admin/network/themes.php

     
    9494<h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php } ?></h2> 
    9595 
    9696<form method="get" action=""> 
    97 <p class="search-box"> 
    98         <label class="screen-reader-text" for="theme-search-input"><?php _e( 'Search Themes' ); ?>:</label> 
    99         <input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    100         <?php submit_button( __( 'Search Installed Themes' ), 'button', '', false ); ?> 
    101 </p> 
     97<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?> 
    10298</form> 
    10399 
    104100<?php $wp_list_table->views(); ?> 
     
    113109</div> 
    114110 
    115111<?php 
    116 include(ABSPATH . 'wp-admin/admin-footer.php'); 
    117  No newline at end of file 
     112include(ABSPATH . 'wp-admin/admin-footer.php'); 
  • wp-admin/network/sites.php

     
    104104</h2> 
    105105 
    106106<form action="" method="get" id="ms-search"> 
    107 <p class="search-box"> 
     107<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?> 
    108108<input type="hidden" name="action" value="blogs" /> 
    109 <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" /> 
    110 <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false ); ?> 
    111 </p> 
    112109</form> 
    113110 
    114111<form id="form-site-list" action="edit.php?action=allblogs" method="post"> 
  • wp-admin/network/site-themes.php

     
    152152<p><?php _e( 'Network enabled themes are not shown on this screen.' ) ?></p> 
    153153 
    154154<form method="get" action=""> 
    155 <p class="search-box"> 
    156         <label class="screen-reader-text" for="theme-search-input"><?php _e( 'Search Themes' ); ?>:</label> 
    157         <input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    158         <?php submit_button( __( 'Search Installed Themes' ), 'button', '', false ); ?> 
    159 </p> 
     155<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?> 
    160156</form> 
    161157 
    162158<?php $wp_list_table->views(); ?> 
     
    170166</form> 
    171167 
    172168</div> 
    173 <?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?> 
    174  No newline at end of file 
     169<?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?> 
  • wp-admin/plugins.php

     
    377377 
    378378<form method="post" action=""> 
    379379 
    380 <?php if ( $wp_list_table->has_items() ) : ?> 
     380<?php $wp_list_table->search_box( __( 'Search Plugins' ), 'plugin' ); ?> 
    381381 
    382 <p class="search-box"> 
    383         <label class="screen-reader-text" for="plugin-search-input"><?php _e( 'Search Plugins' ); ?>:</label> 
    384         <input type="text" id="plugin-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    385         <?php submit_button( __( 'Search Installed Plugins' ), 'button', '', false ); ?> 
    386 </p> 
    387  
    388 <?php endif; ?> 
    389  
    390382<input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" /> 
    391383<input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" /> 
    392384 
  • wp-admin/edit.php

     
    242242 
    243243<form id="posts-filter" action="" method="get"> 
    244244 
    245 <?php if ( $wp_list_table->has_items() ) : ?> 
     245<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?> 
    246246 
    247 <p class="search-box"> 
    248         <label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label> 
    249         <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" /> 
    250         <?php submit_button( $post_type_object->labels->search_items, 'button', 'submit', false ); ?> 
    251 </p> 
    252  
    253 <?php endif; ?> 
    254  
    255247<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" /> 
    256248<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" /> 
    257249 
  • wp-admin/link-manager.php

     
    7676 
    7777<form id="posts-filter" action="" method="post"> 
    7878 
    79 <?php if ( $wp_list_table->has_items() ) : ?> 
     79<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?> 
    8080 
    81 <p class="search-box"> 
    82         <label class="screen-reader-text" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label> 
    83         <input type="text" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    84         <?php submit_button( __( 'Search Links' ), 'button', '', false ); ?> 
    85 </p> 
    86  
    87 <?php endif; ?> 
    88  
    8981<?php $wp_list_table->display(); ?> 
    9082 
    9183<div id="ajax-response"></div> 
  • wp-admin/themes.php

     
    146146 
    147147<h3><?php _e('Available Themes'); ?></h3> 
    148148 
    149 <?php if ( $wp_list_table->has_items() ) : ?> 
     149<?php if ( !empty( $_REQUEST['s'] ) || $wp_list_table->has_items() ) : ?> 
    150150 
    151151<form class="search-form filter-form" action="" method="get"> 
    152152