Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created September 12, 2012 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BFTrick/3707875 to your computer and use it in GitHub Desktop.
Save BFTrick/3707875 to your computer and use it in GitHub Desktop.
Store Locator Plus Example show_search_form Hook
/*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" );
@BFTrick
Copy link
Author

BFTrick commented Sep 12, 2012

For testing purposes you can remove the return $result; and replace it with echo $result;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment