Get all settings recognized by this module. This function will return all settings whether or not they have been stored in the database yet. This ensures that all keys are available at all times. In the event that you only require one setting, you may pass its name as the first parameter to the function and only that value will be returned.
Parameters
$keystringoptional
The key of a recognized setting.Default: 'all'
Return
mixed
Array of all settings by default. A single value if passed as first parameter.
Uses · 3
get_option()Retrieves an option value based on an option name.
_x()Retrieves translated string with gettext context.
wp_parse_args()Merges user defined arguments into defaults array.
458publicstaticfunctionget_setting($key='all'){459$saved=(array)get_option('featured-content');460461$defaults=array(462'hide-tag'=>1,463'tag-id'=>0,464'tag-name'=>_x('featured','featured content default tag slug','twentyfourteen'),465);466467$options=wp_parse_args($saved,$defaults);468$options=array_intersect_key($options,$defaults);469470if('all'!==$key){471returnisset($options[$key])?$options[$key]:false;472}473474return$options;475}
History
Introduced in Twenty Fourteen 1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-content/themes/twentyfourteen/inc/featured-content.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.