function thb_woocommerce_extra_options()
 {
     $thb_theme = thb_theme();
     $thb_page = $thb_theme->getAdmin()->getMainPage();
     $thb_tab = $thb_page->getTab('woocommerce');
     $thb_container = $thb_tab->createContainer(__('Shop general options', 'thb_text_domain'), 'woocommerce_general_options');
     $thb_field = new THB_YesNoField('enable_shop_cart_allpages');
     $thb_field->setLabel(__('Enable shop cart on all pages', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose if you want to enable the shop cart on header on all pages or only for "Shop" related pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_container = $thb_tab->getContainer('woocommerce_shop_options');
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_layout');
     $thb_field->setLabel(__('Page header layout', 'thb_text_domain'));
     $thb_field->setOptions(array('left' => __('Left', 'thb_text_domain'), 'center' => __('Center', 'thb_text_domain'), 'right' => __('Right', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_height');
     $thb_field->setLabel(__('Page header height', 'thb_text_domain'));
     $thb_field->setOptions(array('pageheader-big' => __('Large', 'thb_text_domain'), 'pageheader-compact' => __('Compact', 'thb_text_domain')));
     $thb_field->setHelp(__('This setting will affect also the shop\'s archive and taxonomy pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_UploadField('woocommerce_shop_pageheader_background_image');
     $thb_field->setLabel(__('Page header background image', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('woocommerce_shop_pageheader_background_opacity');
     $thb_field->setMin(0);
     $thb_field->setMax(1);
     $thb_field->setStep(0.05);
     $thb_field->setLabel(__('Page header background opacity', 'thb_text_domain'));
     $thb_container->addField($thb_field);
 }
Exemplo n.º 2
0
 function thb_theme_layout_options()
 {
     global $page_templates, $single_post, $portfolio, $masonry, $page_layout_templates;
     $thb_container = new THB_MetaboxFieldsContainer('', 'extra_container');
     $thb_field = new THB_SelectField('pageheader_layout');
     $thb_field->setLabel(__('Page header alignment', 'thb_text_domain'));
     $thb_field->setOptions(array('left' => __('Left', 'thb_text_domain'), 'center' => __('Center', 'thb_text_domain'), 'right' => __('Right', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_SelectField('pageheader_height');
     $thb_field->setLabel(__('Page header height', 'thb_text_domain'));
     $thb_field->setOptions(array('pageheader-big' => __('Large', 'thb_text_domain'), 'pageheader-compact' => __('Compact', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_ColorField('background_color');
     $thb_field->setLabel(__('Background color', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('background_opacity');
     $thb_field->setLabel(__('Background opacity', 'thb_text_domain'));
     $thb_field->setMin('0');
     $thb_field->setMax('1');
     $thb_field->setStep('0.05');
     $thb_field->setDefault('0.85');
     $thb_container->addField($thb_field);
     foreach ($page_layout_templates as $template) {
         if (thb_is_admin_template($template)) {
             $post_type = thb_theme()->getPostType(thb_get_post_type_from_template($template));
             $post_type->getMetabox('layout')->addContainer($thb_container);
         }
     }
 }