Make WordPress Core


Ignore:
Timestamp:
07/23/2016 10:58:23 AM (8 years ago)
Author:
ocean90
Message:

List Table: Improve WP_Plugins_List_Table::search_box() which was added in [38033].

  • Update DocBlock to use third-person singular verb and to include a period at the end.
  • Use submit_button() for the submit button.
  • Escape the ID attribute.
  • Apply the same to WP_List_Table::search_box().

See #37230.

File:
1 edited

Legend:

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

    r38141 r38146  
    343343
    344344    /**
    345      * Display the search box.
     345     * Displays the search box.
    346346     *
    347347     * @since 4.6.0
    348348     * @access public
    349349     *
    350      * @param string $text The search button text
    351      * @param string $input_id The search input id
     350     * @param string $text     The 'submit' button label.
     351     * @param string $input_id ID attribute value for the search input field.
    352352     */
    353353    public function search_box( $text, $input_id ) {
     
    366366        ?>
    367367        <p class="search-box">
    368             <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
    369             <input type="search" id="<?php echo $input_id ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>"/>
    370             <input type="submit" id="search-submit" class="button hide-if-js" value="<?php echo esc_attr( $text ); ?>">
     368            <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
     369            <input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>"/>
     370            <?php submit_button( $text, 'button hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?>
    371371        </p>
    372372        <?php
Note: See TracChangeset for help on using the changeset viewer.