/** Loads the Future theme setting. */
function future_get_settings()
{
    global $future;
    /* If the settings array hasn't been set, call get_option() to get an array of theme settings. */
    if (!isset($future->settings)) {
        $future->settings = apply_filters('future_options_filter', wp_parse_args(get_option('future_options', future_options_default()), future_options_default()));
    }
    /** return settings. */
    return $future->settings;
}
Exemple #2
0
 /** Future Options Validation */
 function future_options_validate($input)
 {
     /** Default */
     $default = future_options_default();
     /** Future Predefined */
     $future_boolean_pd = $this->future_boolean_pd();
     $future_content_sidebar_layout_pd = $this->future_content_sidebar_layout_pd();
     $future_nav_style_pd = $this->future_nav_style_pd();
     $future_post_style_pd = $this->future_post_style_pd();
     $future_featured_image_pd = $this->future_featured_image_pd();
     /* Validation: future_blog_layout */
     if (!array_key_exists($input['future_blog_layout'], $future_content_sidebar_layout_pd)) {
         $input['future_blog_layout'] = $default['future_blog_layout'];
     }
     /* Validation: future_nav_style */
     if (!array_key_exists($input['future_nav_style'], $future_nav_style_pd)) {
         $input['future_nav_style'] = $default['future_nav_style'];
     }
     /* Validation: future_post_style */
     if (!array_key_exists($input['future_post_style'], $future_post_style_pd)) {
         $input['future_post_style'] = $default['future_post_style'];
     }
     /* Validation: future_featured_image_control */
     if (!array_key_exists($input['future_featured_image_control'], $future_featured_image_pd)) {
         $input['future_featured_image_control'] = $default['future_featured_image_control'];
     }
     /* Validation: future_reset_control */
     if (!array_key_exists($input['future_reset_control'], $future_boolean_pd)) {
         $input['future_reset_control'] = $default['future_reset_control'];
     }
     /** Reset Logic */
     if ($input['future_reset_control'] == 1) {
         $input = $default;
     }
     return $input;
 }