function thb_sidebars_metabox($post_type = null) { $thb_theme = thb_theme(); // $thb_post_type = $thb_theme->getPostType($post_type); $thb_metabox = new THB_Metabox(__('Sidebar', 'thb_text_domain'), 'sidebar'); $thb_metabox->setPosition('side'); $thb_container = thb_sidebars_metabox_container($post_type); $thb_metabox->addContainer($thb_container); // $thb_post_type->addMetabox($thb_metabox); return $thb_metabox; }
function thb_works_slideshow_metabox() { $thb_theme = thb_theme(); $thb_works = $thb_theme->getPostType('works'); $thb_metabox = new THB_Metabox(__('Work images and videos', 'thb_text_domain'), 'portfolio_slides_config'); $thb_metabox->setPriority('high'); if (thb_config('core/portfolio', 'work_slides_config')) { $thb_metabox->addContainer(call_user_func(thb_config('core/portfolio', 'work_slides_config'))); } $thb_metabox->addContainer(thb_create_slideshows_slides_container('', array('slides_key' => thb_config('core/portfolio', 'work_slides_key')))); $thb_works->addMetabox($thb_metabox); }
/** * Create a slides metabox in Slideshow post type pages. * * @return THB_Metabox */ function thb_create_slideshows_posttype_slides_metabox() { $thb_metabox = new THB_Metabox(__('Slideshow contents', 'thb_text_domain'), 'slideshow_contents'); $thb_metabox->setPriority('high'); $thb_container = new THB_MetaboxFieldsContainer('', 'slideshow_contents_container'); $thb_field = new THB_SelectField('slideshow_contents'); $thb_field->setLabel(__('Select slides from', 'thb_text_domain')); $thb_field->setDynamicOptions('thb_slideshow_contents'); $thb_container->addField($thb_field); $thb_metabox->addContainer($thb_container); $thb_container = thb_create_slideshows_slides_container(); $thb_metabox->addContainer($thb_container); $contents = thb_slideshow_contents(); $contents_taxonomies = array(); foreach ($contents as $post_type => $label) { if (!is_numeric($post_type)) { foreach (thb_get_post_type_taxonomies($post_type) as $tax) { $contents_taxonomies[] = $tax; } } } $thb_container = new THB_MetaboxFieldsContainer('', 'slideshow_contents_details_container'); $thb_field = new THB_QueryFilterField('slideshows_query'); $thb_field->setTaxonomies($contents_taxonomies); $thb_container->addField($thb_field); $thb_metabox->addContainer($thb_container); return $thb_metabox; }
function thb_single_layout_options() { $post_types = thb_theme()->getPostTypes(); foreach ($post_types as $pt) { if ($pt->isPublicContent() || $pt->getType() == 'post' || $pt->getType() == 'page') { $thb_metabox = new THB_Metabox(__('Layout', 'thb_text_domain'), 'layout'); $thb_metabox->setPriority('high'); $thb_metabox->addContainer(thb_layout_global_options_container()); $pt->addMetabox($thb_metabox); } } }
/** * Add the Flexslider configuration options to the Slideshow config metabox. * * @param THB_Metabox $thb_metabox The Slideshow configuration metabox. * @return THB_Metabox */ function thb_flexslider_config_container($thb_metabox) { $thb_container = thb_flexslider_config_create_container(); $thb_metabox->addContainer($thb_container); return $thb_metabox; }