Skip to Content

update_option()

Update a Nebula option outside of the Nebula Options page.

PHP June 20, 2017

Usage

PHP
nebula()->update_option($option, $value)

Parameters

$option
(Required) (String) The option to update
Default: None

$value
(Required) (String) The updated value for this option
Default: None

Request or provide clarification »

Additional Notes

This is a convenient function to use because Nebula options are stored in an array.

Source File

Located in /libs/Options/Options.php on line 62.

No Hooks

This function does not have any filters or actions available. Request one?
PHP
        public function update_option($option, $value){
            if ( current_user_can('manage_options') ){
                $nebula_options = get_option('nebula_options');
                if ( empty($nebula_options[$option]) || $nebula_options[$option] !== $value ){
                    $nebula_options[$option] = $value;
                    update_option('nebula_options', $nebula_options);
                }
            }
        }

Override

This function can not be short-circuited with an override filter. Request one?