/** * Registers the setting in the Term Meta Manager * * @param G1_Term_Meta_Manager $manager */ public function register_individual_term_setting($manager) { // Get post types with support for required feature $taxonomies = $this->get_taxonomies(array($this->individual_feature)); $choices = $this->get_template_manager()->get_templates_choices(); $empty = trailingslashit(get_template_directory_uri()) . 'images/admin-assets/inherit.png'; $choices = array('' => $empty) + $choices; if (count($taxonomies)) { $setting_id = '_g1[' . $this->get_individual_setting_id() . ']'; $manager->add_setting($setting_id, array('apply' => $taxonomies, 'view' => new G1_Form_Image_Choice_Control($setting_id, array('label' => __('Template', 'g1_theme'), 'choices' => $choices)), 'section' => 'g1_term_single', 'priority' => 190)); $setting_id = '_g1[' . $this->get_individual_setting_id() . '_sidebar_1]'; $manager->add_setting($setting_id, array('apply' => $taxonomies, 'view' => new G1_Form_Choice_Control($setting_id, array('label' => __('Sidebar', 'g1_theme'), 'choices' => array_merge(array('' => 'inherit'), g1_sidebar_get_choices()))), 'section' => 'g1_term_single', 'priority' => 192)); $setting_id = '_g1[' . $this->get_individual_setting_id() . '_effect]'; $manager->add_setting($setting_id, array('apply' => $taxonomies, 'view' => new G1_Form_Choice_Control($setting_id, array('label' => __('Effect', 'g1_theme'), 'choices' => array('' => __('inherit', 'g1_theme'), 'none' => __('none', 'g1_theme'), 'grayscale' => __('grayscale', 'g1_theme')))), 'section' => 'g1_term_single', 'priority' => 195)); } }
/** * Registers basic elements */ protected function register_basic_elements() { // sidebar-1 $this->add_element('sidebar-1', array('label' => __('Sidebar', 'g1_theme'), 'choices' => g1_sidebar_get_choices(), 'priority' => 210)); // breadcrumbs $this->add_element('breadcrumbs', array('label' => __('Breadcrumbs', 'g1_theme'), 'priority' => 212)); // title $this->add_element('title', array('label' => __('Title', 'g1_theme'), 'priority' => 220)); // featured-media $this->add_element('media-box', array('label' => __('Media Box', 'g1_theme'), 'choices' => array('list' => __('List', 'g1_theme'), 'featured-media' => __('Featured Media', 'g1_theme'), 'none' => __('None', 'g1_theme')), 'help' => '<p>' . __('A media box is a part of a template, that displays entry attachments.', 'g1_theme') . '</p>' . '<p>' . __('The <strong>list</strong> displays image & audio attachments.', 'g1_theme') . '</p>' . '<p>' . __('The <strong>slider</strong> displays only image attachments.', 'g1_theme') . '</p>' . '<p>' . __('The <strong>featured media</strong> displays featured image.', 'g1_theme') . '</p>' . '<p>' . __('The <strong>none</strong> displays nothing.', 'g1_theme') . '</p>', 'priority' => 230)); // date $this->add_element('date', array('label' => __('Date', 'g1_theme'), 'priority' => 240)); // author $this->add_element(new G1_Single_Element_Author('author', array('label' => __('Author', 'g1_theme'), 'priority' => 250))); // comments-link $this->add_element('comments-link', array('label' => __('Comments Link', 'g1_theme'), 'priority' => 260)); // categories $this->add_element('categories', array('label' => __('Categories', 'g1_theme'), 'priority' => 280)); // tags $this->add_element('tags', array('label' => __('Tags', 'g1_theme'), 'priority' => 290)); }