*** # Settings Class Settings * Full name: `\CourierNotices\Model\Settings` ## Properties ### option_key Option key to save settings ```php protected string $option_key ``` *** ### defaults Default settings ```php private array $defaults ``` *** ## Methods ### __construct Initialize our class and setup our settings key ```php public __construct(string $option_key = 'courier_settings'): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$option_key` | **string** | | *** ### get_settings Get saved settings ```php public get_settings(): array ``` *** ### get_setting Get an individual option from our options array ```php public get_setting(string $key = ''): mixed|null ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$key` | **string** | | *** ### save_setting Saves a single setting ```php 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. | *** ### save_settings_array Similar to the save_setting method but allows for passing of array data as well ```php public save_settings_array(mixed $settings = array()): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$settings` | **mixed** | | *** ### save_settings Saves an array of settings ```php 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 on 2024-08-26