SLP_Experience
extends SLP_BaseClass_Addon
in package
Class SLP_Experience
Tags
Table of Contents
Properties
- $activation_class_name : string
- $addon : SLP_BaseClass_Addon
- $admin : mixed
- $admin_class_name : string
- $admin_menu_entries : array<string|int, mixed>
- $ajax : SLP_BaseClass_AJAX
- $ajax_class_name : string
- $dir : string
- $file : string
- $language_dir : string
- $latest_version : mixed
- $meta : SLP_AddOns_Meta
- $metadata : mixed
- $min_slp_version : string
- $myslp : MySLP
- $name : string
- $objects : array<string|int, mixed>
- $option_defaults : array<string|int, mixed>
- $option_name : string
- $options : mixed
- $options_defaults : array<string|int, mixed>
- $short_slug : string
- $slplus : SLPlus
- $slug : string
- $textdomain : string
- $Updates : SLP_AddOn_Updates
- $url : string
- $userinterface : SLP_BaseClass_UI
- $userinterface_class_name : string
- $uses_myslp : bool
- $uses_slplus : bool
- $version : string
- $widget : SLP_BaseClass_Widget
- $widget_class_name : string
- $WPOption_Manager : SLP_WPOption_Manager
- $class_prefix : mixed
Methods
- __construct() : mixed
- __get() : mixed
- Get the value, running it through a filter.
- __isset() : bool
- Allow isset to be called on private properties.
- __set() : SLP_Option|null
- Allow value to be set directly.
- add_allowed_origins() : mixed
- Add allowed CORS origins.
- add_hooks_and_filters() : mixed
- Add cross-element hooks & filters.
- add_object() : mixed
- create_object() : mixed
- Instantiate our objects ONCE and refer to them in an object array.
- create_object_Updates() : mixed
- Creates updates object AND checks for updates for this add-on.
- 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
- filter_AddMenuItems() : array<string|int, mixed>
- Add the items specified in the menu_entries property to the SLP menu.
- filter_FieldDataToManageLocations() : string
- Render the extra fields on the manage location table.
- filter_Locations_Export_Data() : array<string|int, mixed>
- Change the export location row data.
- filter_Locations_Export_Field() : array<string|int, mixed>
- Change the export location field.
- get_addon_version() : string
- Get the add-on pack version.
- get_instance() : static
- 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.
- init_options() : mixed
- Initialize the options properties from the WordPress database.
- instantiate() : null|object
- Instantiate an object of the noted class.
- load_options() : mixed
- Load the options class to help the SLP smart options if we have that feature.
- run_during_init() : void
- Executes actions during the initialization process.
- select_cities_in_state() : string
- SQL to select all cities within the given state.
- 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.
- setting_name() : string
- Generate a proper setting name for the settings class.
- slp_init() : mixed
- Things to do once SLP is alive.
- at_startup() : mixed
- Things to do at startup after this baby is initialized. Override in your class.
- initialize() : void
- Initialize the primary settings and properties for the class.
- set_default_object_options() : mixed
- Set default options for objects. Override in your class.
Properties
$activation_class_name
public
string
$activation_class_name
The name of the activation class for this add on.
$addon
public
SLP_BaseClass_Addon
$addon
$admin
public
mixed
$admin
$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
public
SLP_BaseClass_AJAX
$ajax
The AJAX object.
$ajax_class_name
public
string
$ajax_class_name
The name of the AJAX class for this add on.
$dir
public
string
$dir
The directory the add-on pack resides in.
$file
public
string
$file
The add on loader file.
$language_dir
public
string
$language_dir
The directory that contains the language translation files
$latest_version
public
mixed
$latest_version
= '0.0.0'
$meta
public
SLP_AddOns_Meta
$meta
$metadata
public
mixed
$metadata
$min_slp_version
public
string
$min_slp_version
Minimum version of SLP required to run this add-on pack in x.y.zz format.
$myslp
public
MySLP
$myslp
$name
public
string
$name
Text name for this add on pack.
$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.
$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(
'address_autocomplete' => 'none',
'address_autocomplete_min' => '3',
'city' => '',
'city_selector' => 'hidden',
'country' => '',
'country_selector' => 'hidden',
'custom_css' => '',
'disable_initial_directory' => '0',
'featured_location_display_type' => 'show_within_radius',
'first_entry_for_city_selector' => '',
// default set in init_options
'first_entry_for_country_selector' => '',
// default set in init_options
'first_entry_for_radius_selector' => '',
// default set in init_options
'first_entry_for_state_selector' => '',
// default set in init_options
'ignore_radius' => '0',
// used only to read in old value from versions < 4.1.05
'installed_version' => '',
'label_for_city_selector' => '',
// default set in init_options
'label_for_country_selector' => '',
// default set in init_options
'label_for_name' => '',
// default set in init_options
'label_for_state_selector' => '',
// default set in init_options
'map_options_scaleControl' => '0',
'map_options_scrollwheel' => '0',
'map_options_mapTypeControl' => '0',
'map_region' => '',
'name_placeholder' => '',
'orderby' => 'sl_distance ASC',
'popup_email_title' => '',
'popup_email_from_placeholder' => '',
'popup_email_subject_placeholder' => '',
'popup_email_message_placeholder' => '',
'search_box_title' => '',
// default set in init_options
'searchnear' => 'world',
'selector_behavior' => 'use_both',
'state' => '',
'state_selector' => 'hidden',
)
$options_defaults
public
array<string|int, mixed>
$options_defaults
Default options.
$short_slug
public
string
$short_slug
The short slug name.
$slplus
public
SLPlus
$slplus
$slug
public
string
$slug
The slug for this plugin, usually matches the plugin subdirectory name.
$textdomain
public
string
$textdomain
The slug for the textdomain
$Updates
public
SLP_AddOn_Updates
$Updates
$url
public
string
$url
The url for this plugin admin features.
$userinterface
public
SLP_BaseClass_UI
$userinterface
$userinterface_class_name
public
string
$userinterface_class_name
The name of the user class for this add on.
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$version
public
string
$version
Current version of this add-on pack in x.y.zz format.
$widget
public
SLP_BaseClass_Widget
$widget
The Widget object.
$widget_class_name
public
string
$widget_class_name
The name of the widget class for this add on.
$WPOption_Manager
public
SLP_WPOption_Manager
$WPOption_Manager
The option manager
$class_prefix
protected
mixed
$class_prefix
= 'SLP_Experience_'
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
Get the value, running it through a filter.
public
__get(string $property) : mixed
Parameters
- $property : string
Return values
mixed —null if not set or the value
__isset()
Allow isset to be called on private properties.
public
__isset(mixed $property) : bool
Parameters
- $property : mixed
Return values
bool__set()
Allow value to be set directly.
public
__set(mixed $property, mixed $value) : SLP_Option|null
Parameters
- $property : mixed
- $value : mixed
Return values
SLP_Option|nulladd_allowed_origins()
Add allowed CORS origins.
public
add_allowed_origins(mixed $origins) : mixed
Parameters
- $origins : mixed
Tags
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_object()
public
add_object(mixed $object) : mixed
Parameters
- $object : mixed
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_Updates()
Creates updates object AND checks for updates for this add-on.
public
create_object_Updates(bool $force) : mixed
Parameters
- $force : bool
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. Called via hook slp_admin_menu_starting setup in this class.
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
filter_AddMenuItems()
Add the items specified in the menu_entries property to the SLP menu.
public
filter_AddMenuItems(array<string|int, mixed> $menuItems) : array<string|int, mixed>
If you make the 'slug' property of the $admin_menu_entries array = $this->addon->short_slug you won't need to set this->addon->admin->admin_page_slug
Parameters
- $menuItems : array<string|int, mixed>
Return values
array<string|int, mixed>filter_FieldDataToManageLocations()
Render the extra fields on the manage location table.
public
filter_FieldDataToManageLocations(string $theData, string $theField, string $theLabel) : string
SLP Filter: slp_column_data
Parameters
- $theData : string
-
- the option_value field data from the database
- $theField : string
-
- the name of the field from the database (should be sl_option_value)
- $theLabel : string
-
- the column label for this column (should be 'Categories')
Return values
stringfilter_Locations_Export_Data()
Change the export location row data.
public
filter_Locations_Export_Data(array<string|int, mixed> $location) : array<string|int, mixed>
Parameters
- $location : array<string|int, mixed>
-
A location data ih associated array
Return values
array<string|int, mixed> —Location data need to export
filter_Locations_Export_Field()
Change the export location field.
public
filter_Locations_Export_Field(mixed $dbFields) : array<string|int, mixed>
Parameters
- $dbFields : mixed
Return values
array<string|int, mixed> —Fields need to export
get_addon_version()
Get the add-on pack version.
public
get_addon_version() : string
Return values
stringget_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() ]) : static
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
staticget_meta()
Get the add on metadata property as specified.
public
get_meta(string $property) : string
Parameters
- $property : string
Return values
stringget_option()
Get an option attribute.
public
get_option(string $property, string $attribute) : mixed
Parameters
- $property : string
- $attribute : string
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|objectload_options()
Load the options class to help the SLP smart options if we have that feature.
public
load_options() : mixed
run_during_init()
Executes actions during the initialization process.
public
run_during_init() : void
Sets the name property with a localized string and calls the parent class's initialization method.
select_cities_in_state()
SQL to select all cities within the given state.
public
select_cities_in_state(string $command) : string
TODO: This should go in the SLP_Experience_Data class and the calling method should use add_filter( 'slp_extend_get_SQL' , array( $this , 'add_data_queries' ) ); See class.userinterface.php
Parameters
- $command : string
-
The name of the command
Return values
string —The SQL
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
boolset_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(mixed $val, mixed $key) : mixed
Parameters
- $val : mixed
- $key : mixed
setting_name()
Generate a proper setting name for the settings class.
public
setting_name(mixed $setting) : string
Parameters
- $setting : mixed
Return values
stringslp_init()
Things to do once SLP is alive.
public
slp_init() : mixed
Tags
at_startup()
Things to do at startup after this baby is initialized. Override in your class.
protected
at_startup() : mixed
NOTE: this will not run at initialization if $this->objects is empty.
initialize()
Initialize the primary settings and properties for the class.
protected
final initialize() : void
Sets version, minimum required version, name, option names, file, and associated class names for activation, admin, AJAX, UI, and widgets. Calls parent class initialize.
set_default_object_options()
Set default options for objects. Override in your class.
protected
set_default_object_options() : mixed