Store Locator Plus® was updated with a “pub/sub” model a few years ago. This feature is a managed interface for jQuery Callbacks that allows disparate Javascript functions to interact with each other. It works much like hooks and filters in WordPress, but solely within the JavaScript runtime space.

The basic premise is any JavaScript function can call a “publish” method that fires off a stack of callbacks.

slp_Filter('slp_map_ready').publish(cslmap);

What is run by those callbacks is set by having a JavaScript module call a “subscribe” method.

slp_Filter( 'slp_map_ready' ).subscribe( this.initialize );

The Two Filter Stacks

The main plugin sets two filters stacks:

  • slp_Admin_Filter() for admin-only pages.
  • slp_Filter() for front end pages.

slp_Filter Publications

v2208.15

  • geocoder_request
    • called by
      • Enterprise territory bounds
  • geocode_results
    • called by
      • Enterprise territory bounds
      • Enterprise “best guess” location on address search
  • load_marker_action
    • called by
      • Map loading interface
  • location_results_header
    • called by
      • Enterprise search results header and list processing
  • location_search_processed
  • location_search_responded
    • called by
      • Enterprise cluster map markers
      • Enterprise clean up post-map loading
  • locations_found
    • called by
      • Enterprise territory processing to drop out-of-bounds locations
  • map_built
  • map_options
    • called by
      • Professional map type control
      • Professional map scroll wheel control
      • Professional map scale control
      • Professional hide map bubble
      • Professional map zoom level
  • marker
  • ready
    • called by
      • Professional automatic geolocation (GPS sensor)
      • Professional location display components (map, lists)
      • Professional custom email form on locations
      • Professional address quick search
        • City, state, zip drop downs
        • Address input
      • Professional search form customization
      • Professional show state selections
  • replace_shortcodes_options
    • called by
      • Enteprise drop down autosubmit
      • Enterprise territory boundaries
      • Enterprise show address guess
  • slp_map_ready
    • called by
      • Professional map configuration
      • Professional automatic geolocation (GPS sensor)
      • Enterprise map loading graphic
  • wrap_location_results
    • called by
      • Enterprise map interface rendering engine

slp_Admin_Filter Publications

v2208.15

  • ajax_post_failure
    • called by
      • delete location
  • ajax_post_info
    • called by…
      • delete location
  • ajax_post_ok
    • called by…
      • delete location
  • exportBulkAction
    • called by…
      • Professional location exports
    • Dynamic publication set at SLP_Locations_table_header() > execute_apply_bulk_action()
  • location_edit_init
    • called by…
      • Professional location editor setup
  • location_map_initialized
  • locations_table_init