<?php

$config = array('title' => sprintf(__('Page General Options', 'wt_admin'), THEME_NAME), 'id' => 'page_general', 'pages' => array('page', 'post'), 'callback' => '', 'context' => 'normal', 'priority' => 'low');
function get_sidebar_options()
{
    $sidebars = wt_get_option('sidebar', 'sidebars');
    if (!empty($sidebars)) {
        $sidebars_array = explode(',', $sidebars);
        $options = array();
        foreach ($sidebars_array as $sidebar) {
            $options[$sidebar] = $sidebar;
        }
        return $options;
    } else {
        return array();
    }
}
$options = array(array("name" => __("Page Intro Area Type", 'wt_admin'), "desc" => __("Choose which type of header area you want to display on this page. Static images / videos are setted in the \"Featured Image\" / \"Whoathemes Featured Video\" areas.", 'wt_admin'), "id" => "_intro_type", "options" => array("default" => "Default", "title" => "Title only", "custom" => "Custom text only", "title_custom" => "Title with custom text", "disable" => "Disable"), "default" => "default", "chosen" => "true", "type" => "wt_select"), array("type" => "wt_group_start", "group_id" => "intro_title", "group_class" => "intro_type"), array("name" => __("Page Intro Custom Title", 'wt_admin'), "desc" => __('If you enter a text here, this will override the default header title.', 'wt_admin'), "id" => "_custom_title", "default" => "", "class" => 'full', "type" => "wt_text"), array("type" => "wt_group_end"), array("type" => "wt_group_start", "group_id" => "intro_text", "group_class" => "intro_type"), array("name" => __("Page Intro Custom Text", 'wt_admin'), "desc" => __('If you enter a text here, this will override your default header custom text only if custom text option above is selected.', 'wt_admin'), "id" => "_custom_introduce_text", "rows" => "2", "default" => "", "type" => "wt_textarea"), array("type" => "wt_group_end"), array("type" => "wt_group_start", "group_id" => "intro_slideshow", "group_class" => "intro_type"), array("name" => __("SlideShow Type", 'wt_admin'), "desc" => __("Select which type of slideshow you want on this page/post.", 'wt_admin'), "id" => "_slideshow_type", "prompt" => __("Choose Slideshow Type", 'wt_admin'), "default" => '', "options" => array("rev" => __('Revolution Slider', 'wt_admin'), "flex" => __('Flex Slider', 'wt_admin'), "nivo" => __('Nivo Slider', 'wt_admin'), "cycle" => __('Cycle Slider', 'wt_admin')), "type" => "wt_select"), array("type" => "wt_group_end"), array("type" => "wt_group_start", "group_id" => "slideshow_rev", "group_class" => "slideshow_type"), array("name" => __("Rev SlideShow Type", 'wt_admin'), "prompt" => __("Choose Slideshow Type", 'wt_admin'), "desc" => __("Select which type of slideshow you want on this page/post.", 'wt_admin'), "id" => "_rev_slideshow", "type" => "wt_selectRev"), array("type" => "wt_group_end"), array("type" => "wt_group_start", "group_id" => "slideshow_layerS", "group_class" => "slideshow_type"), array("name" => __("Layer SlideShow Type", 'wt_admin'), "prompt" => __("Choose Slideshow Type", 'wt_admin'), "desc" => __("Select which type of slideshow you want on this page/post.", 'wt_admin'), "id" => "_layer_slideshow", "type" => "wt_selectLayerS"), array("type" => "wt_group_end"), array("name" => __("Disable Breadcrumbs", 'wt_admin'), "desc" => __('This option disables breadcrumbs on a page/post.', 'wt_admin'), "id" => "_disable_breadcrumb", "label" => "Check to disable breadcrumbs on this post", "default" => "", "type" => "wt_tritoggle"), array("name" => __("Custom Sidebar", 'wt_admin'), "desc" => __("If there are any custum sidebars created in your theme option panel then you can choose one of them to be displayed on this.", 'wt_admin'), "id" => "_sidebar", "prompt" => __("Choose one...", 'wt_admin'), "default" => '', "options" => get_sidebar_options(), "type" => "wt_select"));
new wt_metaboxes($config, $options);
Example #2
0
<?php

$config = array('title' => sprintf(__('%s Page General Options', 'striking_admin'), THEME_NAME), 'id' => 'page_general', 'pages' => array('page', 'portfolio'), 'callback' => '', 'context' => 'normal', 'priority' => 'high');
function get_sidebar_options()
{
    $sidebars = theme_get_option('sidebar', 'sidebars');
    if (!empty($sidebars)) {
        $sidebars_array = explode(',', $sidebars);
        $options = array();
        foreach ($sidebars_array as $sidebar) {
            $options[$sidebar] = $sidebar;
        }
        return $options;
    } else {
        return array();
    }
}
$options = array(array("name" => __("Header Introduce Text Type", 'striking_admin'), "desc" => __("Here you can override the general header Introduce text options on a post by post basis.", 'striking_admin'), "id" => "_introduce_text_type", "options" => array("default" => "Default", "title" => "Title only", "custom" => "Custom text", "title_custom" => "Title & custom text", "disable" => "Disable"), "default" => "default", "type" => "radio"), array("name" => __("Custom Header Introduce Text", 'striking_admin'), "desc" => __('If the "custom text" option is selected above any text you enter here will override your general custom header teaser text option.', 'striking_admin'), "id" => "_custom_introduce_text", "rows" => "2", "default" => "", "type" => "textarea"), array("name" => __("Feature Background Color", 'striking_admin'), "desc" => __("If you specify a color below, this will override the global configuration. Set transparent to disable this.", 'striking_admin'), "id" => "_introduce_background_color", "default" => "", "type" => "color"), array("name" => __("Disable Breadcrumbs", 'striking_admin'), "desc" => __('Here you can disable breadcrumbs on a post by post basis. Alternatively you can globally disable breadcrumbs under the "General Settings" tab in your theme\'s option panel.', 'striking_admin'), "id" => "_disable_breadcrumb", "label" => "Check to disable breadcrumbs on this post", "default" => "", "type" => "toggle"), array("name" => __("Custom Sidebar", 'striking_admin'), "desc" => __("Select the custom sidebar that you'd like to be displayed on this.<br />Note: you will need to first create a custom sidebar in your themes option panel before it will show up here.", 'striking_admin'), "id" => "_sidebar", "prompt" => __("Choose one..", 'striking_admin'), "default" => '', "options" => get_sidebar_options(), "type" => "select"));
new metaboxesGenerator($config, $options);
<?php

$config = array('title' => __('Blog Single Options', 'wt_admin'), 'id' => 'single', 'pages' => array('post'), 'callback' => '', 'context' => 'normal', 'priority' => 'low');
$options = array(array("name" => __("Featured Post Entry", 'wt_admin'), "desc" => __("Here you can choose to dispaly or not Featured Image/Video/Mp3/Slideshow in Single Blog post only.", 'wt_admin'), "id" => "_featured_image", "default" => '', "type" => "wt_tritoggle"), array("name" => __("Thumbnail Types", 'wt_admin'), "desc" => sprintf(__("Thumbnail Types", 'wt_admin'), THEME_NAME), "id" => "_thumbnail_type", "default" => 'timage', "options" => array("timage" => __('Image', 'wt_admin'), "tvideo" => __('Video', 'wt_admin'), "tplayer" => __('Audio', 'wt_admin'), "tslide" => __('Slide', 'wt_admin')), "type" => "wt_select"), array("type" => "wt_group_start", "group_id" => "thumbnail_player", "group_class" => "featured_type"), array("name" => __("SoundCloud Link", 'wt_admin'), "desc" => __("The SoundCloud url, ex: <b>\"https://soundcloud.com/fiersa/fiersa-besari-roar-katy-perry\"</b> or <b>\"http://api.soundcloud.com/tracks/129129144\"</b>", 'wt_admin'), "size" => 30, "id" => "_thumbnail_player", "default" => '', "class" => 'full', "type" => "wt_text"), array("type" => "wt_group_end"), array("type" => "wt_group_start", "group_id" => "thumbnail_slide", "group_class" => "featured_type"), array("name" => __("Slide Type", 'wt_admin'), "id" => "_slide_type", "desc" => __("Here you can choose the type of slideshow you want to use on this post.", 'wt_admin'), "default" => 'owl', "options" => array("owl" => 'Owl Slider', "flex" => 'Flex Slider', "nivo" => 'Nivo Slider'), "type" => "wt_select"), array("name" => __("Flex Slide Effect", 'wt_admin'), "id" => "_flex_slide_effect", "desc" => __("Here you can choose the FLEX slide effect.", 'wt_admin'), "default" => 'fade', "options" => array("fade" => 'Fade', "slide" => 'Slide'), "type" => "wt_select"), array("name" => __("Nivo Slide Effect", 'wt_admin'), "id" => "_slide_effect", "desc" => __("Here you can choose the NIVO slide effect.", 'wt_admin'), "default" => 'slideInLeft', "options" => array("sliceDown" => 'sliceDown', "sliceDownLeft" => 'sliceDownLeft', "sliceUp" => 'sliceUp', "sliceUpLeft" => 'sliceUpLeft', "sliceUpDown" => 'sliceUpDown', "sliceUpDownLeft" => 'sliceUpDownLeft', "fade" => 'fade', "fold" => 'fold', "random" => 'random', "slideInRight" => 'slideInRight', "slideInLeft" => 'slideInLeft', "boxRandom" => 'boxRandom', "boxRain" => 'boxRain', "boxRainReverse" => 'boxRainReverse', "boxRainGrow" => 'boxRainGrow', "boxRainGrowReverse" => 'boxRainGrowReverse'), "type" => "wt_select"), array("type" => "wt_group_end"), array("name" => __("Layout", 'wt_admin'), "desc" => __("Choose the layout for this single page/post.", 'wt_admin'), "id" => "_sidebar_alignment", "default" => 'default', "options" => array("default" => __('Default', 'wt_admin'), "full" => __('Full Width', 'wt_admin'), "right" => __('Right Sidebar', 'wt_admin'), "left" => __('Left Sidebar', 'wt_admin')), "type" => "wt_select"), array("name" => __("Disable Breadcrumbs", 'wt_admin'), "desc" => __('This option disables breadcrumbs on a page/post.', 'wt_admin'), "id" => "_disable_breadcrumb", "label" => "Check to disable breadcrumbs on this post", "default" => "", "type" => "wt_tritoggle"), array("name" => __("Custom Sidebar", 'wt_admin'), "desc" => __("If there are any custum sidebars created in your theme option panel then you can choose one of them to be displayed on this.", 'wt_admin'), "id" => "_sidebar", "prompt" => __("Choose one..", 'wt_admin'), "default" => '', "options" => get_sidebar_options(), "type" => "wt_select"));
new wt_metaboxes($config, $options);