Skip to content

$titan->setOption() not saving data to database #421

@shohag121

Description

@shohag121

Hey,
I want to save the changed value for an option from other function of my plugin.
When using setOption() and setting new value; I'm getting the new value (using getOption() ) for that titan instance only but it's not saving the value in the database permanently. When recalling the value from another page, it just returns the default value.

Currently, I'm doing:
$titan = TitanFramework::getInstance('my-plugin');
$color = $titan->getOption('theme-color')
Getting $color value red.
$titan->setOption('theme-color', 'Green')
$color = $titan->getOption('theme-color')
Getting $color value Green.

But On other page:

$titan = TitanFramework::getInstance('my-plugin');
$color = $titan->getOption('theme-color')
Getting $color value still red.

What am I missing here?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions