How to check if searchform.php is being included as widget?
Check if searchform is included? The get_search_form() function (that should be used) uses locate_template(‘searchform.php’); to display the search form. The later returns (as you can see from its source) the template filename if one is located So if you’re just wanting to catch the default way, then you should simply test ‘searchform.php’ === locate_template( ‘searchform.php’ … Read more