Options_API
Options API Class.
Namespace: WebberZone\Snippetz
Since: 2.3.0
Source: includes/class-options-api.php line 21
Methods
init() static
Initialize hooks for AJAX functionality.
Since: 2.3.0
Line: 52
static public function init( );
get_settings() static
Get Settings.
Retrieves all plugin settings
Since: 2.3.0
Line: 63
static public function get_settings( ): array;
Returns: array — Glue Link settings
get_option() static
Get an option
Looks to see if the specified setting exists, returns default if not
Since: 2.3.0
Line: 88
static public function get_option( $key = ..., $default_value = ... ): mixed;
| Type | Name | Description |
|---|---|---|
string | $key | Option to fetch. |
mixed | $default_value | Default option. |
Returns: mixed
update_option() static
Update an option
Updates a setting value in both the db and the global variable. Warning: Passing in an empty, false or null string value will remove the key from the settings array.
Since: 2.3.0
Line: 138
static public function update_option( $key = ..., $value = ... ): boolean;
| Type | Name | Description |
|---|---|---|
string | $key | The Key to update. |
string|bool|int | $value | The value to set the key to. |
Returns: boolean — True if updated, false if not.
update_settings() static
Update all settings at once.
Since: 2.3.0
Line: 172
static public function update_settings( array $settings, bool $merge = ..., bool $autoload = ... ): bool;
| Type | Name | Description |
|---|---|---|
array | $settings | Settings array to save. |
bool | $merge | Whether to merge with existing settings. Default true. |
bool | $autoload | Whether to autoload the option. Default true. |
Returns: bool — True if updated, false otherwise.
delete_option() static
Remove an option
Removes a Glue Link setting value in both the db and the static variable.
Since: 2.3.0
Line: 195
static public function delete_option( $key = ... ): boolean;
| Type | Name | Description |
|---|---|---|
string | $key | The Key to delete. |
Returns: boolean — True if updated, false if not.
get_settings_defaults() static
Default settings.
Since: 2.3.0
Line: 226
static public function get_settings_defaults( ): array;
Returns: array — Default settings
get_default_option() static
Get the default option for a specific key
Since: 2.3.0
Line: 238
static public function get_default_option( $key = ... ): mixed;
| Type | Name | Description |
|---|---|---|
string | $key | Key of the option to fetch. |
Returns: mixed
reset_settings() static
Reset settings.
Since: 2.3.0
Line: 255
static public function reset_settings( ): bool;
Returns: bool — True if updated, false if not.