function ot_get_option($option_id, $default = '') { /* get the saved options */ $options = get_option('option_tree'); /* look for the saved value */ if (isset($options[$option_id]) && '' != $options[$option_id]) { return $options[$option_id]; save_ot_values(); } return $default; }
function ot_after_theme_options_save() { $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : ''; $updated = isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated'] == 'true' ? true : false; /* only execute after the theme options are saved */ if ('ot-theme-options' == $page && $updated) { /* grab a copy of the theme options */ $options = get_option('option_tree'); /* execute the action hook and pass the theme options to it */ do_action('ot_after_theme_options_save', $options); save_ot_values(); } }