SLPĀ® phpDocs

MySLP_AJAX extends SLP_BaseClass_AJAX
in package

Class MySLP_AJAX

Table of Contents

Properties

$addon  : SLP_BaseClass_Addon
$formdata  : array<string|int, mixed>
$formdata_defaults  : array<string|int, mixed>
$formdata_set  : bool
$myslp  : MySLP
$plugin  : mixed
$query_params  : array<string|int, mixed>
$query_params_valid  : array<string|int, string>
$short_action  : string
$slplus  : SLPlus
$uses_myslp  : bool
$uses_slplus  : bool
$valid_actions  : array<string|int, string>
$slug  : mixed
$active_addon  : mixed
$csvImporter  : mixed

Methods

__construct()  : mixed
Contructor
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
add_ajax_hooks()  : mixed
Override this with the WordPress AJAX hooks you want to invoke.
delete_single_location()  : mixed
Delete single location.
do_ajax_startup()  : mixed
Things we do to latch onto an AJAX processing environment.
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.
is_valid_ajax_action()  : mixed
Return true if the AJAX action is one we process.
process_management_data()  : mixed
Management Data tab processing
process_management_ui()  : mixed
Management UI tab processing
sanitize_query_params()  : mixed|string
A less aggressive query param processor.
save_app_mode()  : mixed
Callback for the ajax action save_app_mode
save_power_option()  : mixed
Save Category Settings
send_JSON_response()  : mixed
Output a JSON response based on the incoming data and die.
set_properties()  : void
Set our properties.
set_QueryParams()  : mixed
Set incoming query and request parameters into object properties.
get_ajax_user_input_data()  : array<string|int, mixed>
Get data from AJAX request, loading defaults as needed.
update_addons_options()  : array<string|int, mixed>

Properties

$formdata

public array<string|int, mixed> $formdata

Form data that comes into the AJAX request in the formdata variable.

$formdata_defaults

public array<string|int, mixed> $formdata_defaults

The formdata default values.

$formdata_set read-only

public bool $formdata_set

Has the formdata been set already?

$query_params_valid

public array<string|int, string> $query_params_valid

Array of valid AJAX query parameters

$short_action read-only

public string $short_action

The shortened (csl_ajax prefix dropped) AJAX action.

$uses_slplus

public bool $uses_slplus

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

$valid_actions

public array<string|int, string> $valid_actions

What AJAX actions are valid for this add on to process? Override in the extended class if not serving the default SLP actions: csl_ajax_onload csl_ajax_search

$active_addon

private mixed $active_addon = array()

Methods

__construct()

Contructor

public __construct([mixed $options = array() ]) : mixed
Parameters
$options : mixed = array()

add_ajax_hooks()

Override this with the WordPress AJAX hooks you want to invoke.

public add_ajax_hooks() : mixed

example: add_action('wp_ajax_csl_ajax_search' , array( $this,'csl_ajax_search' )) // For logged in users add_action('wp_ajax_nopriv_csl_ajax_search' , array( $this,'csl_ajax_search' )) // Not logged-in users

delete_single_location()

Delete single location.

public delete_single_location() : mixed

Use this as backup once the REST API don't work

do_ajax_startup()

Things we do to latch onto an AJAX processing environment.

public do_ajax_startup() : mixed

Add WordPress and SLP hooks and filters only if in AJAX mode.

WP syntax reminder: add_filter( <filter_name> , , , # of params )

Remember: can be a simple function name as a string