WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/23/2016 10:58:23 AM (4 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-list-table.php

    r38028 r38146  
    336336
    337337    /**
    338      * Display the search box.
    339      *
    340      * @since 3.1.0
    341      * @access public
    342      *
    343      * @param string $text The search button text
    344      * @param string $input_id The search input id
     338     * Displays the search box.
     339     *
     340     * @since 3.1.0
     341     * @access public
     342     *
     343     * @param string $text     The 'submit' button label.
     344     * @param string $input_id ID attribute value for the search input field.
    345345     */
    346346    public function search_box( $text, $input_id ) {
     
    360360?>
    361361<p class="search-box">
    362     <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
    363     <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
    364     <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
     362    <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
     363    <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
     364    <?php submit_button( $text, 'button', '', false, array( 'id' => 'search-submit' ) ); ?>
    365365</p>
    366366<?php
Note: See TracChangeset for help on using the changeset viewer.