Recent

Options_API class

Options_API

Options API Class.

Namespace: WebberZone\WFP
Since: 3.2.0
Source: includes/class-options-api.php line 23

Methods

init() static

Initialize hooks for AJAX functionality.

Since: 3.2.0
Line: 54

static public function init(  );

get_settings() static

Get Settings.

Retrieves all plugin settings.

Since: 3.2.0
Line: 66

static public function get_settings(  ): array;

Returns: array — WFP settings.

get_option() static

Get an option.

Looks to see if the specified setting exists, returns default if not.

Since: 3.2.0
Line: 92

static public function get_option( $key = ..., $default_value = ... ): mixed;
TypeNameDescription
string$keyOption to fetch.
mixed$default_valueDefault option.

Returns: mixed

update_option() static

Update an option.

Updates a setting value in both the db and the static variable. Warning: Passing in an empty, false or null string value will remove the key from the settings array.

Since: 3.2.0
Line: 142

static public function update_option( $key = ..., $value = ... ): boolean;
TypeNameDescription
string$keyThe Key to update.
string|bool|int$valueThe value to set the key to.

Returns: boolean — True if updated, false if not.

update_settings() static

Update all settings at once.

Since: 3.2.0
Line: 176

static public function update_settings( array $settings, bool $merge = ..., bool $autoload = ... ): bool;
TypeNameDescription
array$settingsSettings array to save.
bool$mergeWhether to merge with existing settings. Default true.
bool$autoloadWhether to autoload the option. Default true.

Returns: bool — True if updated, false otherwise.

delete_option() static

Remove an option.

Removes a setting value in both the db and the static variable.

Since: 3.2.0
Line: 199

static public function delete_option( $key = ... ): boolean;
TypeNameDescription
string$keyThe Key to delete.

Returns: boolean — True if updated, false if not.

get_settings_defaults() static

Default settings.

Since: 3.2.0
Line: 230

static public function get_settings_defaults(  ): array;

Returns: array — Default settings.

get_default_option() static

Get the default option for a specific key.

Since: 3.2.0
Line: 242

static public function get_default_option( $key = ... ): mixed;
TypeNameDescription
string$keyKey of the option to fetch.

Returns: mixed

reset_settings() static

Reset settings.

Since: 3.2.0
Line: 259

static public function reset_settings(  ): bool;

Returns: bool — True if updated, false if not.

clear_cache() static

Clear the static settings cache.

Since: 3.2.0
Line: 277

static public function clear_cache(  ): void;

Returns: void