SLP_WPOption_Manager
extends SLPlus_BaseClass_Object
in package
Assist with WP option I/O to add fitlers to delete/get/update wp_options.
Table of Contents
Properties
- $option_nojs_slug : string
- $option_nojs_slug : mixed
- $option_slug : string
- $option_slug : mixed
- $slplus : SLPlus
- $uses_slplus : bool
- $slplus : mixed
- $uses_slplus : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- delete_smart_option() : mixed
- Delete a smart option.
- delete_wp_option() : mixed
- Delete the Store Locator Plus options from the WordPress options table.
- get_instance() : SLPlus_BaseClass_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- get_wp_option() : mixed
- Fetch the Store Locator Plus options from the WordPress options table.
- initialize() : mixed
- Things we do at startup.
- set_properties() : mixed
- Set our properties.
- update_wp_option() : mixed
- Update the WordPress option.
- set_the_slug() : mixed|null
- Set the option slug.
Properties
$option_nojs_slug
public
string
$option_nojs_slug
Used by the get_wp_option('nojs') call.
$option_nojs_slug
public
mixed
$option_nojs_slug
$option_slug
public
string
$option_slug
Used by the get_wp_option('js') call.
$option_slug
public
mixed
$option_slug
$slplus
public
SLPlus
$slplus
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slplus
protected
mixed
$slplus
$uses_slplus
protected
mixed
$uses_slplus
= \true
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
booldelete_smart_option()
Delete a smart option.
public
delete_smart_option(string $option) : mixed
Parameters
- $option : string
-
The slug for the option to delete
delete_wp_option()
Delete the Store Locator Plus options from the WordPress options table.
public
delete_wp_option([string $which_option = 'default' ]) : mixed
Default option name is csl-slplus-options per $this->option_slug.
Parameters
- $which_option : string = 'default'
-
'default' , 'js' , 'nojs' or the option name.
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_Objectget_wp_option()
Fetch the Store Locator Plus options from the WordPress options table.
public
get_wp_option([string $which_option = 'default' ][, mixed $default = false ]) : mixed
Default option name is csl-slplus-options per $this->option_slug.
Parameters
- $which_option : string = 'default'
-
'default' , 'js' , 'nojs' or the option name.
- $default : mixed = false
initialize()
Things we do at startup.
public
initialize() : mixed
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
update_wp_option()
Update the WordPress option.
public
update_wp_option([string $which_option = 'default' ][, mixed $option_values = null ]) : mixed
Parameters
- $which_option : string = 'default'
-
'default' , 'js' , 'nojs' or the option name.
- $option_values : mixed = null
-
values to be stored
set_the_slug()
Set the option slug.
private
set_the_slug(string $which_option, string $mode) : mixed|null
Parameters
- $which_option : string
-
'js', 'nojs', or the option name
- $mode : string
-
'get' or 'update'