-
Notifications
You must be signed in to change notification settings - Fork 0
Settings
linchpin edited this page Feb 22, 2023
·
10 revisions
Class Settings
- Full name:
\CourierNotices\Model\Settings
Option key to save settings
protected string $option_key
Default settings
private array $defaults
Initialize our class and setup our settings key
public __construct(string $option_key = 'courier_settings'): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$option_key |
string |
Get saved settings
public get_settings(): array
Get an individual option from our options array
public get_setting(string $key = ''): mixed|null
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
string |
Saves a single setting
public save_setting(string $key, mixed $value): array|false
Array keys must be whitelisted (see $this->defaults)
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
string | The setting name. |
$value |
mixed | The value of the setting. |
Similar to the save_setting method but allows for passing of array data as well
public save_settings_array(mixed $settings = array()): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$settings |
mixed |
Saves an array of settings
public save_settings(\WP_REST_Request $request): mixed
Array keys must be whitelisted (see $this->defaults)
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\WP_REST_Request |
Automatically generated from source code comments on 2023-02-22 using phpDocumentor and saggre/phpdocumentor-markdown