Unyson
Unyson copied to clipboard
Getting option variable in functions.php
Hi I have used this code to get option value in footer.php . My question is how can I access this variable in functions.php?
Thanks
$font=fw_get_db_settings_option('google_font');
echo $font['color'];
var_dump($font);
functions.php is loaded before Unyson is ready. When the framework is loaded, it fires an action fw_init. So add in functions.php this:
function _action_theme_fw_init_test() {
$font = fw_get_db_settings_option('google_font');
echo $font['color'];
var_dump($font);
}
add_action('fw_init', '_action_theme_fw_init_test');
Thanks a lot. +1 for explanation .