Created
September 12, 2012 16:25
-
-
Save BFTrick/3707875 to your computer and use it in GitHub Desktop.
Store Locator Plus Example show_search_form Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*base function*/ | |
function slp_show_search_form(){ | |
$showSearchForm = true; | |
$showSearchForm = apply_filters( 'slp_modify_show_search_form', $showSearchForm ); | |
$result = ""; | |
if($showSearchForm){ | |
//show the form | |
$result = "some html"; | |
} | |
return $result; | |
} | |
/*example developer implementation*/ | |
//modify the $showSearchForm variable | |
function slp_modify_show_search_form_filter($showSearchForm){ | |
return false; | |
} | |
//add the filters | |
add_filter( "slp_modify_show_search_form", "slp_modify_show_search_form_filter" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For testing purposes you can remove the
return $result;
and replace it withecho $result;