Settings
Handles plugin settings.
Tags
Table of Contents
- OPTION_NAME = 'wdm_settings'
- delete_option() : bool
- Removes a setting value in the database.
- get_option() : mixed
- Get an option Looks to see if the specified setting exists, returns default if not.
- update_option() : bool
- Update an option.
Constants
OPTION_NAME
public
mixed
OPTION_NAME
= 'wdm_settings'
Methods
delete_option()
Removes a setting value in the database.
public
static delete_option([string $key = '' ]) : bool
Parameters
- $key : string = ''
-
The Key to delete.
Return values
bool —True if removed, false if not.
get_option()
Get an option Looks to see if the specified setting exists, returns default if not.
public
static get_option([string $key = '' ][, mixed $default = false ]) : mixed
Parameters
- $key : string = ''
-
the key to retrieve.
- $default : mixed = false
-
default value to use in case option is not available.
Return values
mixed —update_option()
Update an option.
public
static update_option([string $key = '' ][, string|bool|int $value = false ][, bool $bypass_cap = false ]) : bool
Updates an etting 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 options array.
Parameters
- $key : string = ''
-
The Key to update.
- $value : string|bool|int = false
-
The value to set the key to.
- $bypass_cap : bool = false
-
whether or not the capability check should be bypassed.
Return values
bool —True if updated, false if not.