Ejemplo n.º 1
0
 function thb_seo_options_tab()
 {
     if (thb_is_super_user()) {
         $thb_page = thb_theme()->getAdmin()->getMainPage();
         $thb_tab = new THB_Tab(__('SEO', 'thb_text_domain'), 'seo');
         $thb_container = $thb_tab->createContainer('', 'seo_options');
         $thb_field = new THB_CheckboxField('seo_enable');
         $thb_field->setLabel(__('Enable SEO', 'thb_text_domain'));
         $thb_field->setHelp(__('This option will enable the search engines optimization component. If you mind to use an external plugin, you might want to disable it.', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_author');
         $thb_field->setLabel(__('Site author', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_description');
         $thb_field->setLabel(__('Site description', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_keywords');
         $thb_field->setLabel(__('Keywords', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_robots');
         $thb_field->setLabel(__('Robots', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('google_site_verification');
         $thb_field->setLabel(__('Google site verification', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_page->addTab($thb_tab);
     }
 }
Ejemplo n.º 2
0
 /**
  * Build the block modals.
  */
 private function buildModals()
 {
     $thb_modal = new THB_Modal($this->getTitle(), $this->getSlug());
     $thb_modal_container = $thb_modal->createContainer('', $this->getSlug() . '_container');
     $thb_field = new THB_TextField('title');
     $thb_field->setLabel(__('Title', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_GraphicRadioField('layout');
     $thb_field->setLabel(__('Layout', 'thb_text_domain'));
     $thb_field->setOptions(thb_portfolio_config('builder_portfolio_layouts'));
     $thb_modal_container->addField($thb_field);
     thb_grid_layout_add_fields($thb_modal_container, thb_portfolio_config('grid_builder_columns'));
     $thb_field = new THB_QueryFilterField('query_filter');
     $thb_field->addClass('full');
     $thb_field->setTaxonomies(thb_get_post_type_taxonomies('works'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_CheckboxField('disable_filter');
     $thb_field->setLabel(__('Disable filter', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_YesNoField('works_ajax_pagination');
     $thb_field->setLabel(__('Use AJAX pagination', 'thb-portfolio'));
     $thb_field->setHelp(__('If the page template supports this feature (e.g. its items are filterable), enabling AJAX pagination won\'t refresh your page while filtering through Portfolio items.', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_modal_container = $thb_modal->createContainer(__('Carousel', 'thb_text_domain'), $this->getSlug() . '_carousel_container');
     thb_carousel_options($thb_modal_container);
     $this->addModal($thb_modal);
 }
Ejemplo n.º 3
0
 function thb_layout_global_options_container()
 {
     $thb_container = new THB_MetaboxFieldsContainer('', 'layout_container');
     if (thb_check_template_config('core/layout', 'meta_options_subtitle')) {
         if (!empty($_POST) || !thb_text_startsWith(thb_get_admin_template(), 'single')) {
             $field = new THB_TextField('subtitle');
             $field->setLabel(__('Page subtitle', 'thb_text_domain'));
             $thb_container->addField($field);
         }
     }
     if (thb_check_template_config('core/layout', 'meta_options_pageheader_disable')) {
         $field = new THB_CheckBoxField('pageheader_disable');
         $field->setDefault(false);
         $field->setLabel(__('Disable page header', 'thb_text_domain'));
         $thb_container->addField($field);
     }
     if (thb_check_template_config('core/layout', 'meta_options_page_boxed')) {
         $field = new THB_CheckBoxField('page_boxed');
         $field->setDefault(false);
         $field->setLabel(__('Box the page content and sidebar', 'thb_text_domain'));
         $field->setHelp(__('Checking this option, the page content and sidebar will both have a color background.', 'thb_text_domain'));
         $thb_container->addField($field);
     }
     if (thb_check_template_config('core/layout', 'meta_options_gutter')) {
         $thb_field = new THB_YesNoField('gutter');
         $thb_field->setDefault(thb_config('core/layout', 'meta_options_gutter_default'));
         $thb_field->setLabel(__('Gutter', 'thb_text_domain'));
         $thb_container->addField($thb_field);
     }
     return $thb_container;
 }
Ejemplo n.º 4
0
 function thb_backup_page()
 {
     $thb_theme = thb_theme();
     $thb_page = new THB_BackupPage(__('Framework settings', 'thb_text_domain'), 'thb-framework_settings');
     // General ---------------------------------------------------------
     $thb_tab = new THB_StaticTab(__('General', 'thb_text_domain'), 'general');
     $thb_tab->setAction('thb_save_super_users');
     $thb_tab->setSubmitLabel(__('Save changes', 'thb_text_domain'));
     $thb_container = $thb_tab->createContainer('', 'framework_settings_container');
     $thb_field = new THB_TextField('thb_super_users');
     $thb_field->setStaticOption('thb_super_users');
     $thb_field->setLabel(__('Super users', 'thb_text_domain'));
     $thb_field->setHelp(sprintf(__('Enter a list of comma separated usernames to hide this page from other users. Can be reset from the <a href="%s">WP options page</a> under <code>thb_super_users</code>.', 'thb_text_domain'), admin_url('options.php')));
     $thb_container->addField($thb_field);
     $thb_page->addTab($thb_tab);
     // Admin customizations --------------------------------------------
     $thb_tab = new THB_Tab(__('Admin customizations', 'thb_text_domain'), 'thb_admin_customizations');
     $thb_container = $thb_tab->createContainer('', 'admin_customizations');
     $thb_field = new THB_UploadField('login_logo');
     $thb_field->setLabel(__('Login logo', 'thb_text_domain'));
     $thb_field->setValue(thb_get_option('login_logo'));
     $thb_field->setHelp(__('Upload an image to be used as a logo in the login screen of your site. Please remember to load a properly dimensioned logo.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextareaField('admin_css');
     $thb_field->setAllowCode();
     $thb_field->setValue(thb_get_option('admin_css'));
     $thb_field->setLabel(__('Custom admin CSS', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_page->addTab($thb_tab);
     // Export options --------------------------------------------------
     $thb_tab = new THB_StaticTab(__('Export', 'thb_text_domain'), 'export');
     $thb_tab->setAction('thb_export');
     $thb_tab->setSubmitLabel(__('Export', 'thb_text_domain'));
     $thb_container = $thb_tab->createContainer('', 'export_container');
     $thb_container->setIntroText(__('Backup your duplicable content (slides, meta fields, etc.), options and customizations to the theme\'s appearance. Upon clicking on the Export button, the browser will prompt you to save a file with a <code>.thb-backup</code> extension which will contain your settings, encrypted.', 'thb_text_domain'));
     $thb_export_duplicable = new THB_CheckboxField('export_duplicable');
     $thb_export_duplicable->setLabel(__('Export duplicable content', 'thb_text_domain'));
     $thb_export_duplicable->setValue('1');
     $thb_container->addField($thb_export_duplicable);
     $thb_export_options = new THB_CheckboxField('export_options');
     $thb_export_options->setLabel(__('Export options', 'thb_text_domain'));
     $thb_export_options->setValue('1');
     $thb_container->addField($thb_export_options);
     $thb_export_skin = new THB_CheckboxField('export_mods');
     $thb_export_skin->setLabel(__('Export skin', 'thb_text_domain'));
     $thb_export_skin->setValue('1');
     $thb_container->addField($thb_export_skin);
     $thb_page->addTab($thb_tab);
     // Import options --------------------------------------------------
     $thb_tab = new THB_StaticTab(__('Import', 'thb_text_domain'), 'import');
     $thb_tab->setAction('thb_import');
     $thb_tab->setSubmitLabel(__('Import', 'thb_text_domain'));
     $thb_container = $thb_tab->createContainer('', 'import_container');
     $thb_container->setIntroText(__('Import a previously saved <code>.thb-backup</code> file. Please note that this will completely overwrite your options or skin settings.', 'thb_text_domain'));
     $thb_upload = new THB_ClassicUploadField('import_data');
     $thb_upload->setLabel(__('Upload backup file', 'thb_text_domain'));
     $thb_container->addField($thb_upload);
     $thb_page->addTab($thb_tab);
     $thb_theme->getAdmin()->addPage($thb_page);
 }
Ejemplo n.º 5
0
                }
            }
        } else {
            if (!is_archive() && !is_search() && !is_404()) {
                if (is_active_sidebar('post-sidebar')) {
                    $classes[] = 'w-sidebar';
                }
            }
        }
        return $classes;
    }
    add_filter('body_class', 'sidebars_body_classes');
}
/**
 * Dynamic sidebars options
 * -----------------------------------------------------------------------------
 */
if (thb_config('core/sidebars', 'options')) {
    $thb_options_page = thb_theme()->getAdmin()->getMainPage();
    $thb_tab = new THB_Tab(__('Sidebars', 'thb_text_domain'), 'sidebars');
    $thb_options_page->addTab($thb_tab, 2);
    if (thb_config('core/sidebars', 'duplicable')) {
        $thb_tab = $thb_options_page->getTab('sidebars');
        $thb_container = $thb_tab->createDuplicableContainer(__('Sidebars', 'thb_text_domain'), 'sidebars');
        $thb_container->addControl(__('Add new sidebar', 'thb_text_domain'), '');
        $thb_container->setSortable();
        $thb_field = new THB_TextField(THB_DUPLICABLE_SIDEBARS);
        $thb_field->setLabel(__('Name', 'thb_text_domain'));
        $thb_container->setField($thb_field);
    }
}
Ejemplo n.º 6
0
 function thb_add_footerstripes_posttype_config_metabox()
 {
     $consumer_key = thb_get_option('twitter_consumer_key');
     $consumer_secret = thb_get_option('twitter_consumer_secret');
     $oauth_token = thb_get_option('twitter_oauth_token');
     $oauth_token_secret = thb_get_option('twitter_oauth_token_secret');
     $config_note = '';
     if ($consumer_key == '' || $consumer_secret == '' || $oauth_token == '' || $oauth_token_secret == '') {
         $config_note = __('Make sure to fill the required Twitter API settings in the "Theme options > Social" tab.', 'thb_text_domain');
     }
     $post_type = thb_theme()->getPostType('footerstripes');
     $thb_metabox = new THB_Metabox(__('Footer contents', 'thb_text_domain'), 'footerstripes_config');
     $thb_container = $thb_metabox->createContainer('', 'footerstripes_config_container');
     $thb_field = new THB_SelectField('footerstripes_content_type');
     $thb_field->setLabel(__('Content type', 'thb_text_domain'));
     $thb_field->setOptions(array('twitter' => __('Twitter', 'thb_text_domain'), 'call-to-action' => __('Call to action', 'thb_text_domain'), 'social' => __('Social', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     // Twitter
     $thb_container = $thb_metabox->createContainer(__('Twitter', 'thb_text_domain'), 'footerstripes_content_type_twitter');
     $thb_container->setIntroText($config_note);
     $thb_field = new THB_TextField('footerstripes_twitter_username');
     $thb_field->setLabel(__('Username', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('footerstripes_twitter_num');
     $thb_field->setLabel(__('Tweets #', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     // Social
     $thb_container = $thb_metabox->createContainer(__('Social', 'thb_text_domain'), 'footerstripes_content_type_social');
     $thb_field = new THB_TextField('footerstripes_social_services');
     $thb_field->setLabel(__('Services', 'thb_text_domain'));
     $thb_field->setHelp(__('Comma separated, order matters', 'thb_text_domain') . '. ' . __('Possible values', 'thb_text_domain') . ': twitter, facebook, googleplus, flickr, youtube, vimeo, pinterest, dribbble, forrst.');
     $thb_container->addField($thb_field);
     // Call to action
     $thb_container = $thb_metabox->createContainer(__('Call to action', 'thb_text_domain'), 'footerstripes_content_type_call-to-action');
     $thb_field = new THB_TextField('footerstripes_call-to-action_big_text');
     $thb_field->setLabel(__('Big text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextareaField('footerstripes_call-to-action_small_text');
     $thb_field->setLabel(__('Small text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('footerstripes_call-to-action_btn_text');
     $thb_field->setLabel(__('Button text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('footerstripes_call-to-action_btn_url');
     $thb_field->setLabel(__('Button URL', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $post_type->addMetabox($thb_metabox);
 }
Ejemplo n.º 7
0
 function thb_home_add_config_metabox()
 {
     $thb_container = thb_theme()->getPostType('page')->getMetabox('layout')->createContainer(__('Twitter', 'thb_text_domain'), 'home-config-twitter');
     $thb_field = new THB_CheckboxField('enable_twitter_home');
     $thb_field->setLabel(__('Enable', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('twitter_home_username');
     $thb_field->setLabel(__('Screen name', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('twitter_home_count');
     $thb_field->setLabel(__('How many tweets', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_container = thb_theme()->getPostType('page')->getMetabox('layout')->createContainer(__('Social links', 'thb_text_domain'), 'home-config-social');
     $thb_field = new THB_CheckboxField('enable_social_home');
     $thb_field->setLabel(__('Enable social', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('social_home_services');
     $thb_field->setLabel(__('Services list', 'thb_text_domain'));
     $thb_field->setHelp(__('Comma separated, order matters. Possible values: twitter, facebook, googleplus, flickr, youtube,	vimeo, pinterest, dribbble,	forrst.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
 }
Ejemplo n.º 8
0
        $thb_upload = new THB_ContactInfoField('contact_info');
        $thb_upload->setLabel(__('Contact information', 'thb_text_domain'));
        $thb_container->setField($thb_upload);
    }
    $thb_container = $thb_tab->createContainer(__('Contact form', 'thb_text_domain'), 'contact_form_data');
    $thb_field = new THB_TextField('contact_email');
    $thb_field->setLabel(__('Email address', 'thb_text_domain'));
    $thb_field->setHelp(__('Emails from the website\'s contact form will be sent to this address.', 'thb_text_domain'));
    $thb_container->addField($thb_field);
    if (thb_config('core/contact', 'map')) {
        $thb_container = $thb_tab->createContainer(__('Map', 'thb_text_domain'), 'contact_map_data');
        $thb_field = new THB_TextField('contact_marker');
        $thb_field->setLabel(__('Map marker text', 'thb_text_domain'));
        $thb_field->setHelp(__('Adding text to the map pin will make it pop up when clicking on it.', 'thb_text_domain'));
        $thb_container->addField($thb_field);
        $thb_field = new THB_TextField('contact_lat_long');
        $thb_field->setLabel(__('Map latitude and longitude', 'thb_text_domain'));
        $thb_field->setHelp(sprintf(__('Insert the latitude and longitude for the Google Map (eg. 44.422, 8.937) in a contact page. Trouble? <a href="%s" target="_blank">Get them here</a>.', 'thb_text_domain'), 'http://itouchmap.com/latlong.html'));
        $thb_container->addField($thb_field);
        $thb_field = new THB_NumberField('contact_zoom');
        $thb_field->setLabel(__('Map zoom', 'thb_text_domain'));
        $thb_field->setHelp(__('A reasonable value ranges from 6 to 16; if left blank, the default value will be 10.', 'thb_text_domain'));
        $thb_container->addField($thb_field);
    }
}
/**
 * Frontend helpers
 * -----------------------------------------------------------------------------
 */
if (!function_exists('thb_contact_map')) {
    function thb_contact_map($params = array())
Ejemplo n.º 9
0
<ol>
	<li>Go to the <a target="_blank" href="https://dev.twitter.com/apps">My applications</a> page on the Twitter website to set up your website as a new Twitter \'application\'. You may need to log-in using your Twitter user name and password.</li>
	<li>If you don\'t already have a suitable \'application\' that you can use for your website, set one up on the <a target="_blank" href="https://dev.twitter.com/apps/new">Create an Application page</a>. It\'s normally best to use the name, description and website URL of the website where you plan to use Rotating Tweets. You don\'t need a Callback URL.</li>
	<li>After clicking <strong>Create your Twitter application</strong>, on the following page, click on <strong>Create my access token</strong>.</li>
	<li>Copy the <strong>Consumer key</strong>, <strong>Consumer secret</strong>, <strong>Access token</strong> and <strong>Access token secret</strong> from your Twitter application page into the settings below.</li>
</ol>', 'thb_text_domain'));
$thb_field = new THB_TextField('twitter_consumer_key');
$thb_field->setLabel(__('Consumer key', 'thb_text_domain'));
$thb_container->addField($thb_field);
$thb_field = new THB_TextField('twitter_consumer_secret');
$thb_field->setLabel(__('Consumer secret', 'thb_text_domain'));
$thb_container->addField($thb_field);
$thb_field = new THB_TextField('twitter_oauth_token');
$thb_field->setLabel(__('Access token', 'thb_text_domain'));
$thb_container->addField($thb_field);
$thb_field = new THB_TextField('twitter_oauth_token_secret');
$thb_field->setLabel(__('Access token secret', 'thb_text_domain'));
$thb_container->addField($thb_field);
$thb_page->addTab($thb_tab);
/**
 * Shortcode
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_social', 'shortcode', 'core/social');
$shortcode->setAttributes(array('show' => '', 'title' => ''));
$shortcode->setExample('[thb_social show=""]');
$shortcode->setLabel(__('Social networks', 'thb_text_domain'));
$shortcode->setType(__('Social', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);
/**
 * Widget
Ejemplo n.º 10
0
/**
 * Portfolio single entries options
 */
function thb_portfolio_single_options()
{
    if (thb_portfolio_framework_check()) {
        $thb_works = thb_theme()->getPostType('works');
        $slide_field = new THB_SlideField(thb_portfolio_config('work_slides_key'));
        $slide_field->setLabel(__('Slide', 'thb-portfolio'));
        $slide_field = apply_filters('thb_work_slide', $slide_field);
        if (thb_is_admin_template('single-works.php') && thb_portfolio_config('single')) {
            $thb_metabox = thb_theme()->getPostType('works')->getMetabox('layout');
            $thb_container = $thb_metabox->createContainer(__('Related works', 'thb-portfolio'), 'related_works');
            $thb_field = new THB_CheckboxField('works_related');
            $thb_field->setLabel(__('Enable a related works section', 'thb-portfolio'));
            $thb_field->setHelp(__('Selecting "Yes" automatically creates a "related works" section at the bottom of a Portfolio item page.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related');
            $thb_container->addField($thb_field);
            $thb_field = new THB_NumberField('works_related_number');
            $thb_field->setLabel(__('Related works to show', 'thb-portfolio'));
            $thb_field->setHelp(__('Choose how many related works you want to display. Defaults to 3.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related_number');
            $thb_container->addField($thb_field);
            $thb_field = new THB_CheckboxField('works_related_thumb');
            $thb_field->setLabel(__('Show thumbnails in related works', 'thb-portfolio'));
            $thb_field->setHelp(__('Choose to enable the display of thumbnails for related works.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related_thumb');
            $thb_container->addField($thb_field);
        }
        $thb_metabox = $thb_works->getMetabox('layout');
        $thb_tab = $thb_metabox->createTab(__('Project data', 'thb-portfolio'), 'extra');
        $thb_tab->setIcon('clipboard');
        // $thb_metabox = new THB_Metabox( __('Project data', 'thb-portfolio'), 'extra' );
        // $thb_metabox->setPriority('high');
        if (thb_portfolio_config('work_external_url')) {
            $thb_container = $thb_tab->createContainer('', 'data_details');
            $field = new THB_TextField('external_url');
            $field->setLabel(__('External URL', 'thb-portfolio'));
            $field->setHelp(__('Insert here an external URL to link to in Portfolio pages directly.', 'thb-portfolio'));
            $thb_container->addField($field);
        }
        if ($work_details = thb_portfolio_config('work_details')) {
            if ($work_details == 'text') {
                $thb_container = $thb_tab->createContainer(__('Details', 'thb-portfolio'), 'details');
                $field = new THB_TextareaField('prj_info');
                $field->setHelp(__('Insert here your project details (Note: accepts basic HTML).', 'thb-portfolio'));
                $thb_container->addField($field);
            } elseif ($work_details == 'keyvalue') {
                $thb_container = $thb_tab->createDuplicableContainer(__('Details', 'thb-portfolio'), 'details');
                $thb_container->setIntroText(__('Click on the "Add" button to start inserting a series of key/value pairs details.', 'thb-portfolio'));
                $thb_container->addControl(__('Add', 'thb-portfolio'), '');
                $thb_container->setSortable();
                $thb_upload = new THB_KeyValueField('prj_info');
                $thb_upload->setLabel(__('Detail', 'thb-portfolio'));
                $thb_container->setField($thb_upload);
            }
        }
        if (thb_portfolio_config('work_slides')) {
            if ($work_slides_config = thb_portfolio_config('work_slides_config')) {
                if (is_callable($work_slides_config)) {
                    $thb_tab->addContainer(call_user_func($work_slides_config));
                }
            }
            $thb_container = new THB_MetaboxDuplicableFieldsContainer(__('Project images and videos', 'thb-portfolio'), 'slides_container');
            $thb_container->setSortable();
            $thb_container->addControl(__('Add images', 'thb-portfolio'), 'add_image', '', array('action' => 'thb_add_multiple_slides', 'title' => __('Add images', 'thb-portfolio')));
            $thb_container->addControl(__('Add video', 'thb-portfolio'), 'add_video', '', array('action' => 'thb_add_video_slide', 'title' => __('Add video', 'thb-portfolio')));
            $thb_container->setField($slide_field);
            $thb_tab->addContainer($thb_container);
            // $thb_works->addMetabox($thb_metabox);
        }
    }
}
Ejemplo n.º 11
0
            }
        }
        if (thb_check_template_config('core/portfolio', 'templates')) {
            add_action('wp_loaded', 'thb_add_portfolio_metabox');
        }
    }
}
/**
 * Portfolio general options
 * -----------------------------------------------------------------------------
 */
if (thb_config('core/portfolio', 'options')) {
    $thb_page = $thb_theme->getAdmin()->getMainPage();
    $thb_tab = new THB_Tab(__('Portfolio', 'thb_text_domain'), 'portfolio');
    $thb_container = $thb_tab->createContainer('', 'single_work_options');
    $thb_field = new THB_TextField('works_url_slug');
    $thb_field->setLabel(__('URL slug', 'thb_text_domain'));
    $thb_field->setHelp(sprintf(__('URL slug for Portfolio items. Defaults to "works". Remember to <a href="%s">re-save the site\'s permalinks</a>.', 'thb_text_domain'), admin_url('options-permalink.php')));
    $thb_container->addField($thb_field);
    if (thb_config('core/portfolio', 'works_navigation')) {
        $thb_field = new THB_YesNoField('works_navigation');
        $thb_field->setLabel(__('Enable navigation between Portfolio items', 'thb_text_domain'));
        $thb_container->addField($thb_field);
    }
    $thb_page->addTab($thb_tab);
}
/**
 * Single Portfolio item
 * -----------------------------------------------------------------------------
 */
if (thb_config('core/portfolio', 'single')) {
Ejemplo n.º 12
0
 /**
  * Create a Slideshow metabox.
  *
  * @return THB_Metabox
  */
 function thb_create_entry_slideshow_metabox()
 {
     $thb_metabox = new THB_Metabox(__('Slideshow', 'thb_text_domain'), 'page-slideshow');
     $thb_container = $thb_metabox->createContainer('', 'config');
     $field = new THB_TextField('slideshow');
     $field->setHelp(__('Use <code>[thb_slideshow id="1"]</code> to include a slideshow.', 'thb_text_domain'));
     $thb_container->addField($field);
     return $thb_metabox;
 }
Ejemplo n.º 13
0
            $field->setLabel(__('URL', 'thb_text_domain'));
            $field->setHelp(__('Optional', 'thb_text_domain') . '.');
            $thb_container->addField($field);
            $thb_posts->addMetabox($thb_metabox);
            break;
        case 'audio':
            $thb_metabox = new THB_Metabox(__('Audio', 'thb_text_domain'), $format);
            $thb_metabox->setPosition('thb_after_title');
            $thb_metabox->setPriority('high');
            $thb_container = $thb_metabox->createContainer('', 'post_' . $format . '_details');
            $field = new THB_TextField('audio_url');
            $field->setLabel(__('URL', 'thb_text_domain'));
            $field->setHelp(__('Insert the URL to an audio file.', 'thb_text_domain'));
            $thb_container->addField($field);
            $thb_posts->addMetabox($thb_metabox);
            break;
        case 'video':
            $thb_metabox = new THB_Metabox(__('Video', 'thb_text_domain'), $format);
            $thb_metabox->setPosition('thb_after_title');
            $thb_metabox->setPriority('high');
            $thb_container = $thb_metabox->createContainer('', 'post_' . $format . '_details');
            $field = new THB_TextField('video_url');
            $field->setLabel(__('URL', 'thb_text_domain'));
            $field->setHelp(__('Insert a YouTube or Vimeo video URL here (e.g. <code>http://vimeo.com/53407474</code>)', 'thb_text_domain'));
            $thb_container->addField($field);
            $thb_posts->addMetabox($thb_metabox);
            break;
        default:
            break;
    }
}