Get your options
In your theme
Goodbye get_option. Welcome get_option
get_option. Welcome get_optionThere are two ways to access to the stored options:
- the classical get_optionWordpress function which needs the option name as a parameter (read the doc ;))
- the new get_optionTeaThemeOptions function which has been upgraded to use the transient API if asked.
Get option in the theme
Instead of using get_option, you can use:
<?php
$my_value = TeaThemeOptions::get_option('my_value', 'default_value');
But writing TeaThemeOptions::get_option is pretty long, right? That's why we suggest you to add these lines in your functions.php, after the Tea Theme Options declaration:
<?php
function _get_option($option, $default = '', $transient = false)
{
    return TeaThemeOptions::get_option($option, $default, $transient);
}
You can now access to your options through:
<?php
$my_value = _get_option('my_value', 'default_value');
Updated less than a minute ago
