How to insert a span inside a search form?
If we look at the source code of get_search_form(), notice that before the form gets rendered, the search_form_format filter hook gets fired. We can use that to add another filter attached to get_search_form where the callback is dependent upon the format. add_filter( ‘search_form_format’, ‘wpse_259716_search_form_format’, 99, 1 ); function wpse_259716_search_form_format( $format ) { if( in_array( $format, … Read more