Store Locator Plus®

SLPPower extends SLP_BaseClass_Addon
in package

The main Power add on class.

Table of Contents

Properties

$activation_class_name  : mixed
$activation_class_name  : string
$addon  : SLP_BaseClass_Addon
$admin  : mixed
$admin  : SLP_Power_Admin
$admin  : SLP_BaseClass_Admin
$admin_class_name  : string
$admin_menu_entries  : mixed
$admin_menu_entries  : array<string|int, mixed>
$ajax  : mixed
$ajax  : SLP_BaseClass_AJAX
$ajax_class_name  : string
$categories_loaded_for  : int
$category_attributes  : array<string|int, string>
$category_attributes  : mixed
$category_data  : SLP_Power_Category_Data
$category_data  : mixed
$category_details  : array<string|int, mixed>
$category_manager  : SLP_Power_Category_Manager
$category_manager  : mixed
$category_meta_option_base  : string
$category_meta_option_base  : mixed
$class_prefix  : string
$class_prefix  : string
$cron  : SLP_Power_Cron
$cron  : mixed
$csvImporter  : SLP_Power_Locations_Import
$csvImporter  : mixed
$current_location_categories  : array<string|int, int>
$current_location_categories  : mixed
$dir  : mixed
$dir  : string
$dir  : string
$dir  : string
$file  : mixed
$file  : string
$instance  : SLPPower
$instance  : mixed
$location_fields  : mixed
$location_fields  : mixed
$messages  : array<string|int, SLP_Message_Manager>
$messages  : mixed
$meta  : mixed
$meta  : SLP_AddOns_Meta
$metadata  : mixed
$min_slp_version  : mixed
$min_slp_version  : string
$name  : mixed
$name  : string
$objects  : array<string|int, mixed>
$objects  : array<string|int, mixed>
$objects  : array<string|int, mixed>
$option_defaults  : mixed
$option_defaults  : array<string|int, mixed>
$option_name  : string
$option_name  : string
$options  : mixed
$options  : array<string|int, mixed>
$options  : array<string|int, mixed>
$options  : array<string|int, mixed>
$options_defaults  : mixed
$options_defaults  : array<string|int, mixed>
$pages  : SLP_Power_Pages
$pages  : mixed
$short_slug  : mixed
$short_slug  : string
$slplus  : SLPlus
$slug  : mixed
$slug  : string
$stores_taxonomy  : SLP_Power_Category_Stores_Taxonomy
$stores_taxonomy  : mixed
$Updates  : mixed
$Updates  : SLP_AddOn_Updates
$url  : mixed
$url  : string
$userinterface  : mixed
$userinterface  : SLP_Power_UI
$userinterface  : SLP_BaseClass_UI
$userinterface_class_name  : mixed
$userinterface_class_name  : string
$uses_slplus  : bool
$using_pages  : bool
$using_pages  : mixed
$version  : mixed
$version  : string
$widget  : mixed
$widget  : SLP_BaseClass_Widget
$widget_class_name  : mixed
$widget_class_name  : string
$WPOption_Manager  : mixed
$WPOption_Manager  : SLP_WPOption_Manager
$addon  : mixed
$admin_class_name  : mixed
$ajax_class_name  : mixed
$class_prefix  : mixed
$objects  : mixed
$option_name  : mixed
$slplus  : mixed
$uses_slplus  : mixed
$cache_icon_strings  : mixed
$categories_loaded_for  : mixed
$category_details  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
__set()  : SLP_Option|null
Allow value to be set directly.
action_DeleteLocationCategories()  : mixed
Delete current location categories from Tagalong categories table.
add_csv_mime_type()  : array<string|int, mixed>
Allows WordPress to process csv file types
add_hooks_and_filters()  : mixed
Add cross-element hooks & filters.
add_icon_directory()  : array<string|int, mixed>
Add our icon directory to the list used by SLP.
add_object()  : mixed
add_REST_endpoints()  : mixed
Add some new REST endpoints.
add_sql_commands()  : string
Return an SQL command component based on the command key provided.
array_to_CSV()  : string
Convert an array to CSV.
create_cron_object()  : mixed
Create the cron object.
create_CSVLocationImporter()  : mixed
Create and attach the \CSVImportLocations object
create_LocationIcons()  : string
Create a category icon array.
create_object()  : mixed
Instantiate our objects ONCE and refer to them in an object array.
create_object_category_data()  : mixed
Setup the category data object.
create_object_import_messages()  : mixed
Attach a message stack to this import object.
create_object_schedule_messages()  : mixed
Attach a message stack to this import object.
create_object_Updates()  : mixed
Creates updates object AND checks for updates for this add-on.
create_string_icon_array()  : string
Create the icon array for a given location.
createobject_Admin()  : mixed
Create the admin interface object and attach to this->admin
createobject_AJAX()  : mixed
Create the AJAX processing object and attach to this->ajax
createobject_UserInterface()  : mixed
Create the user interface object and attach to this->UserInterface
createstring_CategoryImageHTML()  : string
Create the image string HTML
createstring_CategoryLegendText()  : string
Create the category title span HTML
filter_AddMenuItems()  : array<string|int, mixed>
Set the admin menu items.
get_addon_version()  : string
Get the add-on pack version.
get_all_crons_for_hook()  : array<string|int, mixed>
Get all the crons for the specified hook.
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
get_meta()  : string
Get the add on metadata property as specified.
get_option()  : mixed
Get an option attribute.
get_TermWithTagalongData()  : array<string|int, mixed>|false
Add extended tagalong data to the category array.
init()  : SLPPower
Initialize a singleton of this object.
init_options()  : mixed
Initialize the options properties from the WordPress database.
instantiate()  : null|object
Instantiate an object of the noted class.
load_options()  : mixed
Grab the specified option from wp_options and put it on top of any default values we've got.
modify_page_title()  : mixed
Modify the HTML <title> tag page title of the current page.
recode_all_uncoded_locations()  : mixed
Recode all the uncoded locations.
set_LocationCategories()  : mixed
Fill the current_location_categories array with the category IDs assigned to the current location.
set_option()  : bool
Set an option attribute.
set_option_defaults()  : mixed
Set option defaults outside of hard-coded property values via an array.
set_properties()  : mixed
Set our properties.
set_ValidOptions()  : mixed
Set valid options according to the addon options array.
set_where_not_valid_lat_long()  : string
Set the NOT where valid lat long clause.
setting_name()  : string
Generate a proper setting name for the settings class.
slp_init()  : mixed
Things to do once SLP is alive.
widgets_init()  : mixed
at_startup()  : mixed
Things we do at the start.
initialize()  : mixed
Do these things when this object is invoked. Override in your class.
set_default_object_options()  : mixed
Set default options for objects. Override in your class.
augment_class()  : string
Augment the class names so we can reference simple property names.
auto_instantiate()  : mixed
Any object with auto_instantiate set to true is instantiate during initialization.
check_my_version_compatibility()  : bool
Check the current version of this Add On works with the latest version of the SLP base plugin.
create_object_option_manager()  : mixed
Create an option manager object for this addon.
create_object_widget()  : mixed
Create and attach the widget object as needed.
createstring_CategoryEditLink()  : string
Create a link to the category editor if warranted.
createstring_CategoryIconHTML()  : string
Create the category HTML output for admin and user interface with images and text.
get_short_slug()  : string
Get the short slug, just the base/directory part of the fully qualified WP slug for this plugin.
init_using_pages()  : mixed
Set using pages and look for incoming change on general tab.
process_bad_category_id()  : mixed
Process a bad category ID.
VersionCheck()  : mixed
Compare current plugin version with minimum required.

Properties

$activation_class_name

public string $activation_class_name

The name of the activation class for this add on.

$admin_class_name

public string $admin_class_name

The name of the admin class for this add on.

$admin_menu_entries

public array<string|int, mixed> $admin_menu_entries

array of menu entries, should be in a key=>value array where key = the menu text and value = the function or PHP file to execute.

$ajax_class_name

public string $ajax_class_name

The name of the AJAX class for this add on.

$categories_loaded_for read-only

public int $categories_loaded_for

Which location ID is the current_location_categories loaded with?

$category_attributes

public array<string|int, string> $category_attributes

Custom attributes for a category. Keys (custom): category_url map-marker medium-icon rank url_target

$category_attributes

public mixed $category_attributes = array('category_url' => '', 'map-marker' => '', 'medium-icon' => '', 'rank' => '', 'url_target' => '')

$category_data

public mixed $category_data

$category_details read-only

public array<string|int, mixed> $category_details

The detailed category term data from the WP taxonomy with custom data as well.

$category_manager

public mixed $category_manager

$category_meta_option_base

public string $category_meta_option_base

The base name for the category meta entry in the options table csl-slplus-TAGALONG-category_<term_id>

$category_meta_option_base

public mixed $category_meta_option_base

$current_location_categories

public array<string|int, int> $current_location_categories

The array of current location category IDs.

$current_location_categories

public mixed $current_location_categories = array()

$location_fields

public mixed $location_fields

Location fields. long field name => shorthand This is used in the AJAX and the UI objects so we share them up here in the add on base class.

$location_fields

public mixed $location_fields = array('sl_city' => 'city', 'sl_country' => 'country', 'sl_state' => 'state', 'territory' => 'territory')

$min_slp_version

public string $min_slp_version

Minimum version of SLP required to run this add-on pack in x.y.zz format.

$objects read-only

public array<string|int, mixed> $objects

A named array of our instantiated objects, the key is the class name the value is the object itself.

$objects

public array<string|int, mixed> $objects

key = class name, array of attributes() object = the instantiated object subdir = the subdirectory (from theme root) that contains the class definition

$objects

public array<string|int, mixed> $objects

key = class name, array of attributes() auto_instantiate = true , instantiate the object when this object initializes object = the instantiated object options = default startup options subdir = the subdirectory (from theme root) that contains the class definition

$option_defaults

public array<string|int, mixed> $option_defaults

The default values for options. Set this in init_options for any gettext elements. $option_defaults['setting'] = __('string to translate', 'textdomain')

$option_name

public string $option_name

The name of the wp_option to store serialized add-on pack settings.

$options

public mixed $options = array( 'city' => '', // Group By Fields by= shortcode attribute 'city_selector' => '', // Group By Fields by= shortcode attribute 'country' => '', // Group By Fields by= shortcode attribute 'country_selector' => '', // Group By Fields by= shortcode attribute 'cron_import_timestamp' => '', 'cron_import_recurrence' => 'none', 'csv_clear_messages_on_import' => '1', 'csv_file_url' => '', 'csv_skip_geocoding' => '0', 'csv_duplicates_handling' => 'update', 'default_comments' => '0', 'default_page_status' => 'publish', 'default_trackbacks' => '0', 'load_data' => '0', 'installed_version' => '', 'pages_read_more_text' => '', 'pages_replace_websites' => '1', 'page_template' => '', 'permalink_starts_with' => 'store-page', 'prevent_new_window' => '1', 'prepend_permalink_blog' => '1', 'state' => '', // Group By Fields by= shortcode attribute 'state_selector' => '', // Group By Fields by= shortcode attribute 'territory' => '', // Group By Fields by= shortcode attribute 'territory_selector' => '', )

$options

public array<string|int, mixed> $options

Settable options for this plugin.

$options

public array<string|int, mixed> $options

Settable options for this plugin. (Does NOT go into main plugin JavaScript)

$options

public array<string|int, mixed> $options

key = option slug, array of attributes() value = the value of the option

$options_defaults

public array<string|int, mixed> $options_defaults

Default options.

$slug

public string $slug

The slug for this plugin, usually matches the plugin subdirectory name.

$stores_taxonomy

public mixed $stores_taxonomy

$userinterface_class_name

public string $userinterface_class_name

The name of the user class for this add on.

$uses_slplus

public bool $uses_slplus

Set to true (default) if the object needs access to the SLPlus plugin object.

$using_pages

public bool $using_pages

Using SLP Pages

$version

public string $version

Current version of this add-on pack in x.y.zz format.

$widget_class_name

public string $widget_class_name

The name of the widget class for this add on.

$class_prefix

protected mixed $class_prefix = 'SLP_Power_'

$cache_icon_strings

private mixed $cache_icon_strings = array()

$categories_loaded_for

private mixed $categories_loaded_for = \null

$category_details

private mixed $category_details = array()

Methods

__construct()

public __construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

action_DeleteLocationCategories()

Delete current location categories from Tagalong categories table.

public action_DeleteLocationCategories() : mixed

add_csv_mime_type()

Allows WordPress to process csv file types

public add_csv_mime_type([array<string|int, mixed> $existing_mimes = array() ]) : array<string|int, mixed>
Parameters
$existing_mimes : array<string|int, mixed> = array()
Tags
used-by

\get_allowed_mime_types

set-via

\SLPPower::add_hooks_and_filters

Return values
array<string|int, mixed>

add_hooks_and_filters()

Add cross-element hooks & filters.

public add_hooks_and_filters() : mixed

Haven't yet moved all items to the AJAX and UI classes.

add_icon_directory()

Add our icon directory to the list used by SLP.

public add_icon_directory(array<string|int, mixed> $directories) : array<string|int, mixed>
Parameters
$directories : array<string|int, mixed>
  • array of directories.
Return values
array<string|int, mixed>

add_REST_endpoints()

Add some new REST endpoints.

public add_REST_endpoints() : mixed

add_sql_commands()

Return an SQL command component based on the command key provided.

public add_sql_commands(string $command) : string
Parameters
$command : string
Return values
string

array_to_CSV()

Convert an array to CSV.

public static array_to_CSV(array<string|int, array<string|int, mixed>> $data) : string
Parameters
$data : array<string|int, array<string|int, mixed>>
Return values
string

create_cron_object()

Create the cron object.

public create_cron_object() : mixed

create_CSVLocationImporter()

Create and attach the \CSVImportLocations object

public create_CSVLocationImporter() : mixed

Check max locations allowed.

create_LocationIcons()

Create a category icon array.

public create_LocationIcons(array<string|int, mixed> $categories[, array<string|int, mixed> $params = array() ]) : string

$params values

  • show_label if true put text under the icons (default: false)
  • add_edit_link if true wrap the output in a link to the category edit page (default: false)

Example /---code php $this->create_LocationIcons($category_list, array('show_label'=>false, 'add_edit_link'=>false)); ---

Parameters
$categories : array<string|int, mixed>

array of category details

$params : array<string|int, mixed> = array()

the parameters

Tags
uses
SLPPower::createstring_CategoryIconHTML
used-by

\SLP_Power_Category_Walker_Legend::start_el

used-by

\SLPPower::create_string_icon_array

Return values
string

html of the icon array

create_object()

Instantiate our objects ONCE and refer to them in an object array.

public create_object(string $class[, string $subdir = '.' ]) : mixed

TODO: Remove and update Power compat to 4.9.1

Parameters
$class : string
$subdir : string = '.'

create_object_category_data()

Setup the category data object.

public create_object_category_data() : mixed

create_object_import_messages()

Attach a message stack to this import object.

public create_object_import_messages() : mixed

create_object_schedule_messages()

Attach a message stack to this import object.

public create_object_schedule_messages() : mixed

create_object_Updates()

Creates updates object AND checks for updates for this add-on.

public create_object_Updates(bool $force) : mixed
Parameters
$force : bool

create_string_icon_array()

Create the icon array for a given location.

public create_string_icon_array([array<string|int, mixed> $params = array() ]) : string

$params array values: 'show_label' = if true show the labels under the icon strings

Parameters
$params : array<string|int, mixed> = array()

named array of settings

Return values
string

createobject_Admin()

Create the admin interface object and attach to this->admin

public createobject_Admin() : mixed

Called on slp_admin_menu_starting. If that menu is rendering, we are on an admin page.

createobject_AJAX()

Create the AJAX processing object and attach to this->ajax

public createobject_AJAX() : mixed

createobject_UserInterface()

Create the user interface object and attach to this->UserInterface

public createobject_UserInterface() : mixed
Tags
used-by

\MySLP_REST_API::get_options

used-by

\SLP_BaseClass_Addon::slp_init via WP Filter wp_enqueue_scripts

createstring_CategoryImageHTML()

Create the image string HTML

public createstring_CategoryImageHTML(array<string|int, mixed> $category[, string $field_name = 'medium-icon' ]) : string
Parameters
$category : array<string|int, mixed>

a taxonomy array

$field_name : string = 'medium-icon'

which category field to get the image from

Return values
string

HTML for presenting an image

createstring_CategoryLegendText()

Create the category title span HTML

public createstring_CategoryLegendText(array<string|int, mixed> $category) : string
Parameters
$category : array<string|int, mixed>

a taxonomy array

Return values
string

HTML for putting category title in a span

filter_AddMenuItems()

Set the admin menu items.

public filter_AddMenuItems(array<string|int, mixed> $menuItems) : array<string|int, mixed>
Parameters
$menuItems : array<string|int, mixed>
Return values
array<string|int, mixed>

get_addon_version()

Get the add-on pack version.

public get_addon_version() : string
Return values
string

get_all_crons_for_hook()

Get all the crons for the specified hook.

public get_all_crons_for_hook( $hook) : array<string|int, mixed>

TODO: put in a new SLP_Cron class.

Parameters
$hook :
Return values
array<string|int, mixed>

get_instance()

Return an instance of the object which is also registered to the slplus global less the SLP_ part.

public static get_instance([bool $no_global = false ][, mixed $params = array() ]) : SLPlus_BaseClass_Object

TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object

Parameters
$no_global : bool = false

set to true to skip assigning object to SLP global as a property.

$params : mixed = array()

object init params

Return values
SLPlus_BaseClass_Object

get_meta()

Get the add on metadata property as specified.

public get_meta(string $property) : string
Parameters
$property : string
Return values
string

get_option()

Get an option attribute.

public get_option(string $property, string $attribute) : mixed
Parameters
$property : string
$attribute : string

get_TermWithTagalongData()

Add extended tagalong data to the category array.

public get_TermWithTagalongData(int $term_id) : array<string|int, mixed>|false
Parameters
$term_id : int

the category term id

Return values
array<string|int, mixed>|false

named array of category attributes

init_options()

Initialize the options properties from the WordPress database.

public init_options() : mixed

instantiate()

Instantiate an object of the noted class.

public instantiate(string $class[, array<string|int, mixed> $options = array() ]) : null|object
Parameters
$class : string
$options : array<string|int, mixed> = array()
Return values
null|object

load_options()

Grab the specified option from wp_options and put it on top of any default values we've got.

public load_options() : mixed

modify_page_title()

Modify the HTML <title> tag page title of the current page.

public modify_page_title(string $title, string $sep, int $sep_pos) : mixed
Parameters
$title : string
$sep : string
$sep_pos : int

recode_all_uncoded_locations()

Recode all the uncoded locations.

public recode_all_uncoded_locations([SLP_Message_Manager $messages = null ][, int $max_id = null ]) : mixed
Parameters
$messages : SLP_Message_Manager = null
$max_id : int = null

set if called from geocode cron

set_LocationCategories()

Fill the current_location_categories array with the category IDs assigned to the current location.

public set_LocationCategories() : mixed

Assumes slplus->currentLocation is loaded with the current location data.

set_option()

Set an option attribute.

public set_option(string $property, string $attribute, mixed $value) : bool
Parameters
$property : string
$attribute : string
$value : mixed
Return values
bool

set_option_defaults()

Set option defaults outside of hard-coded property values via an array.

public set_option_defaults() : mixed

This allows for gettext() string translations of defaults.

Only bring over items in default_value_array that have matching keys in $this->options already.

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

set_ValidOptions()

Set valid options according to the addon options array.

public set_ValidOptions( $val,  $key) : mixed
Parameters
$val :
$key :

set_where_not_valid_lat_long()

Set the NOT where valid lat long clause.

public set_where_not_valid_lat_long(string $where) : string
Parameters
$where : string
Return values
string

setting_name()

Generate a proper setting name for the settings class.

public setting_name( $setting) : string
Parameters
$setting :
Return values
string

slp_init()

Things to do once SLP is alive.

public slp_init() : mixed
Tags
used-by

\SLP_BaseClass_Addon::initialize via SLP Filter slp_init_complete

uses
SLP_BaseClass_Addon::createobject_UserInterface

via WP Filter wp_enqueue_scripts

widgets_init()

public widgets_init() : mixed

at_startup()

Things we do at the start.

protected at_startup() : mixed

initialize()

Do these things when this object is invoked. Override in your class.

protected initialize() : mixed

set_default_object_options()

Set default options for objects. Override in your class.

protected set_default_object_options() : mixed

augment_class()

Augment the class names so we can reference simple property names.

private augment_class(string $class) : string
Parameters
$class : string
Return values
string

auto_instantiate()

Any object with auto_instantiate set to true is instantiate during initialization.

private auto_instantiate() : mixed

check_my_version_compatibility()

Check the current version of this Add On works with the latest version of the SLP base plugin.

private check_my_version_compatibility() : bool
Return values
bool

create_object_option_manager()

Create an option manager object for this addon.

private create_object_option_manager() : mixed

If an addon has ./include/options/<class_prefix>Options.php load it up.

create_object_widget()

Create and attach the widget object as needed.

private create_object_widget() : mixed

Create a link to the category editor if warranted.

private createstring_CategoryEditLink(int $category_id, string $html) : string
Parameters
$category_id : int

the category ID

$html : string

the HTML output to be wrapped

Return values
string

the HTML wrapped in a link to the category editor.

createstring_CategoryIconHTML()

Create the category HTML output for admin and user interface with images and text.

private createstring_CategoryIconHTML(array<string|int, mixed> $category, array<string|int, mixed> $params) : string

$params values

  • show_label if true put text under the icons (default: false)
  • add_edit_link if true wrap the output in a link to the category edit page (default: false)

Example /---code php $this->createstring_CategoryIconHTML($category, array('show_label'=>false, 'add_edit_link'=>false)); ---

Parameters
$category : array<string|int, mixed>

a taxonomy array

$params : array<string|int, mixed>

the parameters we accept

Tags
used-by

\SLPPower::create_LocationIcons

uses
SLPPower::createstring_CategoryImageHTML
uses
SLPPower::createstring_CategoryLegendText

with show_label param set

uses
SLPPower::createstring_CategoryEditLink

with add_edit_link param set

Return values
string

HTML for the category output on UI and admin panels

get_short_slug()

Get the short slug, just the base/directory part of the fully qualified WP slug for this plugin.

private get_short_slug() : string
Return values
string

init_using_pages()

Set using pages and look for incoming change on general tab.

private init_using_pages() : mixed

We need to catch this super early in the stack before action processing.

process_bad_category_id()

Process a bad category ID.

private process_bad_category_id( $id) : mixed
Parameters
$id :

VersionCheck()

Compare current plugin version with minimum required.

private VersionCheck(array<string|int, mixed> $params) : mixed

Set a notification message. Disable the requesting add-on pack if requirement is not met.

$params['addon_name'] - the plain text name for the add-on pack. $params['addon_slug'] - the slug for the add-on pack. $params['min_required_version'] - the minimum required version of the base plugin.

Parameters
$params : array<string|int, mixed>

        
On this page

Search results