SLP® phpDocs

SLPWidget_cities_UI extends SLP_BaseClass_UI
in package

Class SLPWidget_cities_UI

Handle all the UI elements for the widget.

Putting this in a separate include file makes the admin loading "lighter".

Table of Contents

Properties

$addon  : mixed
$js_requirements  : array<string|int, string>
$js_settings  : array<string|int, string>
$jsHandle  : mixed
$myslp  : MySLP
$slplus  : mixed
$uses_myslp  : bool
$uses_slplus  : bool
$widget  : mixed
$slug  : mixed
$current_instance  : mixed
$selected_city  : mixed
$selected_state  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
add_hooks_and_filters()  : mixed
Add the plugin specific hooks and filter configurations here.
create_string_city_dropdown()  : string
Build the city dropdown.
enqueue_ui_css()  : mixed
If the file userinterface.css exists, enqueue it.
enqueue_ui_javascript()  : mixed
Enqueue the userinterface.js scripts (./js/<slug>_userinterface.min.js preferred).
get_instance()  : static
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
initialize()  : mixed
Instantiate the admin panel object.
render_widget()  : mixed
Render the widget on the front end UI.
set_properties()  : mixed
Set our properties.
trigger_cities_ajax_on_state_selection()  : string
Set JavaScript that trigger cities dropdown replacement on state selection.
at_startup()  : mixed
Things we want our add on packs to do when they start.
create_state_then_city_dropdowns()  : string
Create the linked state to city drop down menus.
create_string_city_options()  : string
Create the option list for the states.
get_selected_city()  : mixed
Determines which city was selected via the cities widget.
get_selected_state()  : mixed
Determines which state was selected via the state widget.

Properties

$js_requirements

public array<string|int, string> $js_requirements

An array of the JavaScript hooks that are needed by the userinterface.js script. userinterface.js is only loaded if the file exists in the include directory.

$js_settings

public array<string|int, string> $js_settings

JavaScript settings that are to be localized as a _settings JS variable.

$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.

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

add_hooks_and_filters()

Add the plugin specific hooks and filter configurations here.

public add_hooks_and_filters() : mixed

Should include WordPress and SLP specific hooks and filters.

create_string_city_dropdown()

Build the city dropdown.

public create_string_city_dropdown() : string
Return values
string

the HTML for the city dropdown

enqueue_ui_javascript()

Enqueue the userinterface.js scripts (./js/<slug>_userinterface.min.js preferred).

public enqueue_ui_javascript() : mixed

Minified take precedence.

Called from \MySLP_REST_API::get_options() to send data to front-end/locations.js for embeding maps.

Look first in ./js/_userinterface.js then ./js/userinterface.js then ./include/userinterface.js

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() ]) : 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
static

render_widget()

Render the widget on the front end UI.

public render_widget(mixed $args, mixed $instance) : mixed
Parameters
$args : mixed
$instance : mixed

set_properties()

Set our properties.

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

trigger_cities_ajax_on_state_selection()

Set JavaScript that trigger cities dropdown replacement on state selection.

public trigger_cities_ajax_on_state_selection() : string
Return values
string

create_state_then_city_dropdowns()

Create the linked state to city drop down menus.

private create_state_then_city_dropdowns() : string
Return values
string

create_string_city_options()

Create the option list for the states.

private create_string_city_options() : string
Return values
string

get_selected_city()

Determines which city was selected via the cities widget.

private get_selected_city() : mixed

get_selected_state()

Determines which state was selected via the state widget.

private get_selected_state() : mixed

        
On this page

Search results