The following action hooks and filters are related to the management and program interface of the Store Locator Plus plugin.
slp_admin_init_complete
Type: action Parameters: none
This hook is fired when the Store Locator Plus is complete and ready to return control back to WordPress.
slp_admin_menu_starting
Type: action Parameters: none
This hook is fired when the Store Locator Plus is ready to start processing the WordPress admin_menu hook. It is called after the manage_slp capability is checked for the user but BEFORE any menu processing begins.
Useful for adding items to the Store Locator Plus sidebar menu and top navigation system.
slp_init_complete
Type: action Parameters: [0] - the main plugin object
The incoming parameter is the instantiated object for the plugin (the legacy $slplus_plugin global).
Use this hook to fire off any actions you want to run once the SLP WordPress init action has been executed.
Code Implementation (SLP v3.9)
/**
* Called when the WordPress init action is processed.
*/
function init() {
if (!$this->setParent()) { return; }
// Do not texturize our shortcodes
//
add_filter('no_texturize_shortcodes',array('SLPlus_UI','no_texturize_shortcodes'));
// Fire the SLP initialized trigger
//
do_action('slp_init_complete', $this);
}
slp_init_starting
Type: action Parameters: [0] - the main plugin object
The incoming parameter is the instantiated object for the plugin (the legacy $slplus_plugin global).
Use this hook to fire off any actions you want to run when the SLP WordPress init action is about to start.
Code Implementation (SLP v3.9)
/**
* Called when the WordPress init action is processed.
*/
function init() {
if (!$this->setParent()) { return; }
// Fire the SLP init starting trigger
//
do_action('slp_init_starting', $this);
}
slp_navbar_item
Default Priority: 10 Category: Admin Panel
The slp_navbar_item filter is used to append elements to the top navbar, after the main SLP and Pro Pack add-on entries are added to the top navigation bar on the SLP admin pages.
The easiest way to add an item with a consistent look & feel is to call the following method on the AdminUI class with the global $slplus_plugin object as follows:
return $slplus_plugin->AdminUI->
add_navbar_item('Locations: Manage', 'view-locations.php', admin_url());
The parameters to add_navbar_item() are, in order, the label, the name of the PHP script to execute, and the base URL that leads to the script. The base URL is the fully-qualified URL that precedes the name of the PHP script. The 3rd parameter and 2nd parameter are joined to form a fully qualified URL.
slp_navbar_item_tweak
Default Priority: 10 Category: Admin Panel
This filter is applied to the individual navbar elements that appear on the top of the SLP admin pages. The default string as of version 3.4 follows the format:
<a href=”…url…”><li>…label…</li></a>
