This problem arises from a difference in how WordPress 3.5.2 and 3.6 handle the case where there is both a searchform.php template AND a filter on the hook get_search_form.
In WordPress 3.5.2 in the presence of a searchform.php template, any filters on the hook get_search_form were ignored. With the upgrade to 3.6, filters on get_search_form are now applied.
This change in behavior came about as a result of http://core.trac.wordpress.org/changeset/23666 with the removal of return;
on line 158. To clarify, I don’t think this is necessarily a bad change but it is a change.
Unfortunately, I have a number of themes built on Genesis (which applies a filter to the hook get_search_form *), which had custom searchform.php templates. The way to avoid this issue is to avoid using searchform.php and instead create your custom search form using a filter on the hook get_search_form. However, the following will work as a quick fix restoring the WordPress 3.5.2 behavior.
Add this code to functions.php in your theme
function search_form_no_filters() { // look for local searchform template $search_form_template = locate_template( 'searchform.php' ); if ( '' !== $search_form_template ) { // searchform.php exists, remove all filters remove_all_filters('get_search_form'); } } add_action('pre_get_search_form', 'search_form_no_filters');
* Note:
In Genesis, the filter on ‘get_search_form’ appears in genesis/lib/structure/search.php
add_filter( 'get_search_form', 'genesis_search_form' );
Cool, this works for me. Thanks Sal for such a great resource.