Ejemplo n.º 1
0
 public function add_theme_options($sections)
 {
     // single templates
     $templates = G1_Single_Template_Manager()->get_templates_choices(array('post_type' => 'post'));
     unset($templates['overview_left']);
     unset($templates['overview_right']);
     $single_options = array();
     foreach ($templates as $template_id => $template_path) {
         $single_options[$template_id] = array('title' => $template_id, 'img' => $template_path);
     }
     $single_std = '';
     if (!empty($single_options)) {
         $single_std = array_keys($single_options);
         $single_std = $single_std[0];
     }
     // archive templates
     $archive_templates = G1_Archive_Template_Manager()->get_templates_choices(array('post_type' => 'post'));
     $archive_options = array();
     foreach ($archive_templates as $template_id => $template_path) {
         // exclude filterable layouts
         if (strpos($template_id, 'filterable') !== false) {
             continue;
         }
         $archive_options[$template_id] = array('title' => $template_id, 'img' => $template_path);
     }
     $archive_std = '';
     if (!empty($archive_options)) {
         $archive_std = array_keys($archive_options);
         $archive_std = $archive_std[0];
     }
     $fields = array();
     $priority = 1;
     foreach ($this->get_post_types() as $post_type) {
         $post_type_label = str_replace('sfwd-', '', $post_type);
         $post_type_label = ucfirst($post_type_label);
         $fields[] = array('id' => 'post_type_' . $post_type . '_info', 'priority' => $priority, 'type' => 'info', 'desc' => '<h4>' . $post_type_label . '</h4>');
         $fields[] = array('id' => 'post_type_' . $post_type . '_single_template', 'priority' => $priority + 1, 'type' => 'radio_img', 'title' => __('Single template', Redux_TEXT_DOMAIN), 'options' => $single_options, 'std' => $single_std);
         $fields[] = array('id' => 'post_type_' . $post_type . '_archive_template', 'priority' => $priority + 2, 'type' => 'radio_img', 'title' => __('Archive template', Redux_TEXT_DOMAIN), 'options' => $archive_options, 'std' => $archive_std);
         $priority += 10;
     }
     $sections['learndash'] = array('priority' => 1100, 'icon' => 'folder-open', 'icon_class' => 'icon-large', 'title' => __('LearnDash', Redux_TEXT_DOMAIN), 'fields' => $fields);
     return $sections;
 }
Ejemplo n.º 2
0
                        $template_obj = $this->get_template_manager()->get_template($term_template);
                        array_unshift($templates, $template_obj->get_file());
                    }
                }
            }
        }
        if (count($templates)) {
            $new_template = locate_template($templates);
            if (!empty($new_template)) {
                return $new_template;
            }
        }
        return $template;
    }
}
new G1_Archive_Template_Feature(array('template_manager' => G1_Archive_Template_Manager()));
class G1_Single_Entry_Settings_Feature
{
    protected $feature;
    public function __construct()
    {
        $this->feature = 'g1-single-entry-settings';
        $this->setup_hooks();
    }
    public function get_feature()
    {
        return $this->feature;
    }
    /**
     * Set up all hooks
     */