Make WordPress Core

Changeset 23798


Ignore:
Timestamp:
03/26/2013 08:27:13 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Use a filter instead of recently added $format argument in get_search_form(). props WraithKenny. fixes #23850. see #15081.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r23794 r23798  
    147147 *
    148148 * @since 2.7.0
     149 * @uses apply_filters() Calls 'search_form_format' filter to determine which type to use for the search field.
     150 *  If set to 'html5', it changes to search input type and adds placeholder text.
     151 *
    149152 * @param boolean $echo Default to echo and not return the form.
    150  * @param string $format Which type to use for the search field. If set to 'html5' it changes to search input type and adds placeholder text.
    151153 * @return string|null String when retrieving, null when displaying or if searchform.php exists.
    152154 */
    153 function get_search_form( $echo = true, $format = 'xhtml' ) {
     155function get_search_form( $echo = true ) {
    154156    do_action( 'get_search_form' );
     157
     158    $format = apply_filters( 'search_form_format', 'xhtml' );
    155159
    156160    $search_form_template = locate_template( 'searchform.php' );
Note: See TracChangeset for help on using the changeset viewer.