Example #1
0
 /**
  * Created the Flexslider configuration options container.
  *
  * @param strubg $label The container label.
  * @param strubg $slug The container slug.
  * @return THB_MetaboxFieldsContainer
  */
 function thb_flexslider_config_create_container($label = '', $slug = 'flexslider_options')
 {
     if (empty($label)) {
         $label = __('Flexslider options', 'thb_text_domain');
     }
     $thb_container = new THB_MetaboxFieldsContainer($label, $slug);
     $field = new THB_NumberField('slideshowHeight');
     $field->setLabel(__('Height', 'thb_text_domain'));
     $field->setMin('0');
     $thb_container->addField($field);
     $field = new THB_YesNoField('flexslider_smoothHeight');
     $field->setLabel(__('Variable height', 'thb_text_domain'));
     $field->setDefault('1');
     $thb_container->addField($field);
     $field = new THB_SelectField('flexslider_effects');
     $field->setLabel(__('Effects', 'thb_text_domain'));
     $field->setOptions(array('fade' => __('Fade', 'thb_text_domain'), 'slide' => __('Slide', 'thb_text_domain')));
     $thb_container->addField($field);
     return $thb_container;
 }
 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);
 }
Example #3
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);
         }
     }
 }
Example #4
0
 function thb_create_slideshows_posttype_config_container($label = '', $slug = 'slideshow_config_container')
 {
     /**
      * Base configuration fields container.
      */
     $thb_container = new THB_MetaboxFieldsContainer('', $slug);
     $field = new THB_NumberField('delay');
     $field->setLabel(__('Delay', 'thb_text_domain'));
     $field->setHelp(__('Expressed in seconds.', 'thb_text_domain'));
     $field->setPlaceholder(__('E.g. 5', 'thb_text_domain'));
     $thb_container->addField($field);
     $field = new THB_NumberField('transition_speed');
     $field->setLabel(__('Transition speed', 'thb_text_domain'));
     $field->setHelp(__('Expressed in seconds.', 'thb_text_domain'));
     $field->setPlaceholder(__('E.g. 1', 'thb_text_domain'));
     $field->setMin('0');
     $field->setStep('0.05');
     $thb_container->addField($field);
     $thb_field = new THB_SelectField('slideshow_type');
     $thb_field->setLabel(__('Type', 'thb_text_domain'));
     $thb_field->setDynamicOptions('thb_slideshows_types');
     $thb_field->setInvisibleIfEmpty(true);
     $thb_container->addField($thb_field);
     return $thb_container;
 }