Settings
in package
Handle requests for site settings values.
- Return a single setting.
- Return all settings.
Tags
Table of Contents
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $settings : array<string|int, mixed>
- Site settings.
Methods
- get() : mixed
- Get a setting value.
- get_instance() : object
- Creates and/or returns the instance of this class.
- __construct() : void
- Initialise the class.
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$settings
Site settings.
protected
array<string|int, mixed>
$settings
= array()
Tags
Methods
get()
Get a setting value.
public
get(string $setting_key[, mixed $default_value = '' ]) : mixed
Parameters
- $setting_key : string
-
The key of the setting to return, or 'all' to return all settings.
- $default_value : mixed = ''
-
The default value to return if the setting is not found.
Tags
Return values
mixed —The setting value or the default value.
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
__construct()
Initialise the class.
protected
__construct() : void