Usage
nebula()->get_option($option, $fallback)
Parameters
$option
(Required) (String) The name of the option.
Default: None
$fallback
(Optional) (String) The data to use if the option is not set or false.
Default: false
Parameter Notes
For a list of core Nebula option names, refer to the default_options documentation.
Examples
Echo a string-based option.
<?php echo nebula()->option('ga_tracking_id'); ?>
String-based with a default if false.
<?php echo nebula()->option('fax_number', 'No fax number'); ?>
Check if a boolean option is enabled.
if ( nebula()->option('scss') ){ //Do something if Sass is enabled. }
Check if a boolean option is disabled.
if ( !nebula()->option('scss') ){ //Do something if Sass is disabled }
Source File
Located in /libs/Options/Options.php on line 46.
No Hooks
This function does not have any filters or actions available. Request one?public function get_option($option, $fallback=false){ $nebula_options = get_option('nebula_options'); if ( empty($nebula_options[$option]) ){ if ( !empty($fallback) ){ return $fallback; } return false; } if ( filter_var($nebula_options[$option], FILTER_VALIDATE_BOOLEAN) === 1 ){ return true; } return $nebula_options[$option]; }
Override
This function can not be short-circuited with an override filter. Request one?