Ticket #19321: 19321.3.patch
File 19321.3.patch, 1.3 KB (added by , 11 years ago) |
---|
-
wp-includes/general-template.php
141 141 * form into the sidebar and also by the search widget in WordPress. 142 142 * 143 143 * There is also an action that is called whenever the function is run called, 144 * ' get_search_form'. This can be useful for outputting JavaScript that the144 * 'pre_get_search_form'. This can be useful for outputting JavaScript that the 145 145 * search relies on or various formatting that applies to the beginning of the 146 146 * search. To give a few examples of what it can be used for. 147 147 * … … 151 151 * @return string|null String when retrieving, null when displaying or if searchform.php exists. 152 152 */ 153 153 function get_search_form( $echo = true, $format = 'xhtml' ) { 154 do_action( ' get_search_form' );154 do_action( 'pre_get_search_form' ); 155 155 156 156 $search_form_template = locate_template( 'searchform.php' ); 157 157 if ( '' != $search_form_template ) { … … 171 171 </form>'; 172 172 } 173 173 174 $result = apply_filters( 'get_search_form', $form ); 175 if ( null === $result ) 176 $result = $form; 177 174 178 if ( $echo ) 175 echo apply_filters( 'get_search_form', $form );179 echo $result; 176 180 else 177 return apply_filters( 'get_search_form', $form );181 return $result; 178 182 } 179 183 180 184 /**