The What
Syntax
mixed get_option ( string $option_name, mixed $default_value = false );
Description
This WordPress function retrieves the specified option from the database (or cache). Options are stored in the options database table. The function queries the database by the option_name
column looking for the specific name you passed into it. If the option exists, then it returns the value from the option_value
column in the database; else the default value is returned.
Parameters
option_name
- Name of the option to be retrieved from the database (or cache). The format is lowercase only and words separated by underscores (_), e.g.
admin_email
. default_value
- optional The default value you want returned if the option does not exist in the database.
Return Values
Returns the option’s value (from the option_value
column in the database), if the option exists; else you get back the default value.
Break. Go rest your noodle for a couple of minutes.
More coming soon…keep checking back.