TouchPointWP_Settings
in package
The Settings class - most settings are available through the default getter.
Table of Contents
Constants
- UNDEFINED_PLACEHOLDER = INF
Properties
- $parent : TouchPointWP|null
- The main plugin object.
Methods
- __clone() : mixed
- Cloning is forbidden.
- __construct() : mixed
- Constructor function.
- __get() : string|false
- __wakeup() : mixed
- Unserializing instances of this class is forbidden.
- add_menu_item() : void
- Add settings page to admin menu
- add_settings_link() : array<string|int, mixed>
- Add settings link to plugin list table
- configureSettings() : array<string|int, mixed>
- Container for settings page arguments
- get() : false|string|array<string|int, mixed>
- Returns the setting, including default values. Returns false if the value is undefined.
- hasValidApiSettings() : bool
- Indicates whether there are adequate settings in place for API calls.
- initSettings() : void
- Initialise settings
- instance() : TouchPointWP_Settings
- Main TouchPointWP_Settings Instance
- migrate() : void
- Migrate settings from version to version. This may be called even when a migration isn't necessary.
- registerSettings() : void
- Register plugin settings
- set() : false|mixed
- settings_section() : void
- Settings section.
- settingsPage() : void
- Load settings page content.
- updateDeployedScripts() : void
- Generate new scripts and deploy to TouchPoint.
- validation_lowercase() : string
- Force a value to lowercase; used as a validator
Constants
UNDEFINED_PLACEHOLDER
public
mixed
UNDEFINED_PLACEHOLDER
= INF
Properties
$parent
The main plugin object.
public
TouchPointWP|null
$parent
= null
Methods
__clone()
Cloning is forbidden.
public
__clone() : mixed
Tags
__construct()
Constructor function.
public
__construct(TouchPointWP $parent) : mixed
Parameters
- $parent : TouchPointWP
-
Parent object.
__get()
public
__get(string $what) : string|false
Parameters
- $what : string
-
The field to get a value for
Return values
string|false —The value, if set. False if not set.
__wakeup()
Unserializing instances of this class is forbidden.
public
__wakeup() : mixed
Tags
add_menu_item()
Add settings page to admin menu
public
add_menu_item() : void
add_settings_link()
Add settings link to plugin list table
public
add_settings_link(array<string|int, mixed> $links) : array<string|int, mixed>
Parameters
- $links : array<string|int, mixed>
-
Existing links.
Return values
array<string|int, mixed> —Modified links.
configureSettings()
Container for settings page arguments
public
configureSettings([array<string|int, mixed>|null $settings = [] ]) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>|null = []
-
Settings array.
Return values
array<string|int, mixed>get()
Returns the setting, including default values. Returns false if the value is undefined.
public
get(string $what) : false|string|array<string|int, mixed>
Parameters
- $what : string
Return values
false|string|array<string|int, mixed>hasValidApiSettings()
Indicates whether there are adequate settings in place for API calls.
public
hasValidApiSettings() : bool
Return values
boolinitSettings()
Initialise settings
public
initSettings() : void
instance()
Main TouchPointWP_Settings Instance
public
static instance([TouchPointWP|null $parent = null ]) : TouchPointWP_Settings
Ensures only one instance of TouchPointWP_Settings is loaded or can be loaded.
Parameters
- $parent : TouchPointWP|null = null
-
Object instance.
Tags
Return values
TouchPointWP_Settings —instance
migrate()
Migrate settings from version to version. This may be called even when a migration isn't necessary.
public
migrate() : void
registerSettings()
Register plugin settings
public
registerSettings() : void
set()
public
set(string $what, mixed $value[, bool $autoload = false ]) : false|mixed
Parameters
- $what : string
- $value : mixed
- $autoload : bool = false
Return values
false|mixedsettings_section()
Settings section.
public
settings_section(array<string|int, mixed> $section) : void
Parameters
- $section : array<string|int, mixed>
-
Array of section ids.
settingsPage()
Load settings page content.
public
settingsPage() : void
updateDeployedScripts()
Generate new scripts and deploy to TouchPoint.
public
updateDeployedScripts() : void
Tags
validation_lowercase()
Force a value to lowercase; used as a validator
public
validation_lowercase(string $data) : string
Parameters
- $data : string
-
Mixed case string
Return values
string —lower-case string