Skip to Content
Menu

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.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

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

    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?