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.
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 (usinggetOption()
) 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.