Ticket #19321: 19321.4.patch
File 19321.4.patch, 1.3 KB (added by , 12 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 * … … 153 153 * @return string|null String when retrieving, null when displaying or if searchform.php exists. 154 154 */ 155 155 function get_search_form( $echo = true ) { 156 do_action( ' get_search_form' );156 do_action( 'pre_get_search_form' ); 157 157 158 158 $format = apply_filters( 'search_form_format', 'xhtml' ); 159 159 … … 175 175 </form>'; 176 176 } 177 177 178 $result = apply_filters( 'get_search_form', $form ); 179 if ( null === $result ) 180 $result = $form; 181 178 182 if ( $echo ) 179 echo apply_filters( 'get_search_form', $form );183 echo $result; 180 184 else 181 return apply_filters( 'get_search_form', $form );185 return $result; 182 186 } 183 187 184 188 /**