Ejemplo n.º 1
0
 public function __construct()
 {
     if (is_admin()) {
         // we need it for all data flexor taxonomies
         $ay_df_taxonomies = array();
         $taxonomies = get_taxonomies();
         foreach ($taxonomies as $taxonomy) {
             if ($this->endswith($taxonomy, '_dftype')) {
                 $ay_df_taxonomies[] = $taxonomy;
             }
         }
         /* 
          * configure your meta box
          */
         $config = array('id' => 'df_meta_box', 'title' => 'Data Flexor', 'pages' => $ay_df_taxonomies, 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
         /*
          * Initiate your meta box
          */
         $my_meta = new Tax_Meta_Class($config);
         //text field
         $my_meta->addText('df_custom_class', array('name' => __('Custom Class Name ', 'tax-meta'), 'desc' => 'Complete if using a dataflexor custom class for display'));
         //checkbox field
         $my_meta->addCheckbox('df_bp_post_activity', array('name' => 'Post in activity stream '));
         /*
          * Don't Forget to Close up the meta box decleration
          */
         //Finish Meta Box Decleration
         $my_meta->Finish();
     }
 }
Ejemplo n.º 2
0
  * configure your meta box
  */
 $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
 /*
  * Initiate your meta box
  */
 $my_meta = new Tax_Meta_Class($config);
 /*
  * Add fields to your meta box
  */
 //text field
 $my_meta->addText($prefix . 'text_field_id', array('name' => __('My Text ', 'tax-meta'), 'desc' => 'this is a field desription'));
 //textarea field
 $my_meta->addTextarea($prefix . 'textarea_field_id', array('name' => __('My Textarea ', 'tax-meta')));
 //checkbox field
 $my_meta->addCheckbox($prefix . 'checkbox_field_id', array('name' => __('My Checkbox ', 'tax-meta')));
 //select field
 $my_meta->addSelect($prefix . 'select_field_id', array('selectkey1' => 'Select Value1', 'selectkey2' => 'Select Value2'), array('name' => __('My select ', 'tax-meta'), 'std' => array('selectkey2')));
 //radio field
 $my_meta->addRadio($prefix . 'radio_field_id', array('radiokey1' => 'Radio Value1', 'radiokey2' => 'Radio Value2'), array('name' => __('My Radio Filed', 'tax-meta'), 'std' => array('radionkey2')));
 //date field
 $my_meta->addDate($prefix . 'date_field_id', array('name' => __('My Date ', 'tax-meta')));
 //Time field
 $my_meta->addTime($prefix . 'time_field_id', array('name' => __('My Time ', 'tax-meta')));
 //Color field
 $my_meta->addColor($prefix . 'color_field_id', array('name' => __('My Color ', 'tax-meta')));
 //Image field
 $my_meta->addImage($prefix . 'image_field_id', array('name' => __('My Image ', 'tax-meta')));
 //file upload field
 $my_meta->addFile($prefix . 'file_field_id', array('name' => __('My File ', 'tax-meta')));
 //wysiwyg field
Ejemplo n.º 3
0
    register_sidebar(array('name' => __('Dataset Sidebar', 'opengov'), 'id' => 'sidebar-dataset', 'description' => __('Widgets in this area will be shown on datasets.', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Page Sidebar', 'opengov'), 'id' => 'sidebar-page', 'description' => __('Widgets in this area will be shown on single pages only.', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Single Sidebar', 'opengov'), 'id' => 'sidebar-single', 'description' => __('Widgets in this area will be shown on single posts only.', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Ideas Sidebar', 'opengov'), 'id' => 'sidebar-ideas', 'description' => __('Widgets in this area will be shown on single ideas only.', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Archives Sidebar', 'opengov'), 'id' => 'sidebar-archives', 'description' => __('Widgets in this area will be shown on archived pagesonly.', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Footer Left Sidebar', 'opengov'), 'id' => 'footer-left', 'description' => __('Footer Left area', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Footer Center Sidebar', 'opengov'), 'id' => 'footer-center', 'description' => __('Footer Center area', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Footer Right Sidebar', 'opengov'), 'id' => 'footer-right', 'description' => __('Footer Right area', 'opengov'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Footer Credits Text', 'opengov'), 'id' => 'footer-credits', 'description' => __('Please use only a TEXT HTML widget!', 'opengov'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''));
}
require_once "lib/Tax-meta-class/Tax-meta-class.php";
if (is_admin()) {
    //examples: https://github.com/bainternet/Tax-Meta-Class/blob/master/class-usage-demo.php
    $config = array('id' => 'opengov_meta_box', 'title' => 'OpenGov Meta Box', 'pages' => array('idea_cat'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    $opengov_cat_meta = new Tax_Meta_Class($config);
    $opengov_cat_meta->addCheckbox('opengov_is_active', array('name' => __('Is Active Call', 'tax-meta')));
    $opengov_cat_meta->addDate('opengov_close_date', array('name' => __('Open Until', 'tax-meta')));
    $opengov_cat_meta->addWysiwyg('opengov_short_descr', array('name' => __('Short Description', 'tax-meta')));
    $opengov_cat_meta->Finish();
}
function insert_attachment($file_handler, $post_id, $meta_name)
{
    if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) {
        __return_false();
    }
    require_once ABSPATH . "wp-admin" . '/includes/image.php';
    require_once ABSPATH . "wp-admin" . '/includes/file.php';
    require_once ABSPATH . "wp-admin" . '/includes/media.php';
    $attach_id = media_handle_upload($file_handler, $post_id);
    $attach_url = wp_get_attachment_url($attach_id);
    update_post_meta($post_id, $meta_name, $attach_url);
Ejemplo n.º 4
0
// for category customization
require_once "Tax-meta-class/Tax-meta-class.php";
global $current_user;
get_currentuserinfo();
/*
* configure taxonomy custom fields
*/
$configt = array('id' => 'categ_meta_box', 'title' => 'Category options', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
/*
* Initiate your taxonomy custom fields
*/
$custom_category = new Tax_Meta_Class($configt);
/*
* Add fields
*/
//Categories image
$custom_category->addImage('categ_img', array('name' => __('Download an image for your category', 'iftheme')));
//Display children checkbox
$custom_category->addCheckbox('categ_children', array('name' => __('Display sub-categories', 'iftheme'), 'desc' => __("Check this box if you want to display a list of child categories", 'iftheme')));
//Display children checkbox
$check = true;
if (isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'category') {
    $check = isset($_GET['tag_ID']) ? get_tax_meta($_GET['tag_ID'], 'categ_posts') : true;
}
$custom_category->addCheckbox('categ_posts', array('name' => __('Display Posts', 'iftheme'), 'desc' => __("Check this box if you want to display a list of the category's posts", 'iftheme'), 'std' => $check));
//hidden field
//to avoid conflict with wpml plugin
//global $current_user; get_currentuserinfo();
//$custom_category->addHidden('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
//$custom_category->addText('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
$custom_category->Finish();
<?php

add_post_type_support('bb_note', 'page-attributes');
function tax_bb_note_type()
{
    $labels = array('name' => _x('Note Type', 'taxonomy general name'), 'singular_name' => _x('Note Type', 'taxonomy singular name'), 'search_items' => __('Search Note Types'), 'all_items' => __('All Note Types'), 'parent_item' => __('Parent Note Type'), 'parent_item_colon' => __('Parent Note Type:'), 'edit_item' => __('Edit Note Type'), 'update_item' => __('Update Note Type'), 'add_new_item' => __('Add New Note Type'), 'new_item_name' => __('New Note Type'), 'menu_name' => __('Note Types'));
    $args = array('labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_tagcloud' => true, 'show_in_nav_menus' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_generic_term_count', 'query_var' => 'bb_note_type', 'rewrite' => array('slug' => 'bb_note_type'));
    register_taxonomy('bb_note_type', array('bb_note'), $args);
}
add_action('init', 'tax_bb_note_type', 0);
add_action('admin_menu', 'bbconnect_register_note_types_page');
function bbconnect_register_note_types_page()
{
    add_submenu_page('users.php', 'Note Types', 'Note Types', 'list_users', 'edit-tags.php?taxonomy=bb_note_type&post_type=bb_note');
}
// Add tax meta
$config = array('id' => 'note_type_meta_box', 'title' => 'Note Type Meta', 'pages' => array('bb_note_type'), 'local_images' => false);
$tax_meta = new Tax_Meta_Class($config);
$tax_meta->addCheckbox('initially_displayed', array('name' => 'Initially Displayed ', 'desc' => 'If ticked, notes of this type will be displayed by default when viewing a Contact\'s notes'));
$tax_meta->Finish();
Ejemplo n.º 6
0
/*
* Initiate your taxonomy custom fields
*/
$my_meta = new Tax_Meta_Class($config);
/*
* Add fields 
*/
//text field
$my_meta->addText('extra_links_header', array('name' => 'Extra Links Header'));
//Image field
$my_meta->addImage('display_image', array('name' => 'Feature Image'));
//wysiwyg field
$my_meta->addWysiwyg('section_links', array('name' => 'Section Links '));
/*
* To Create a reapeater Block first create an array of fields
* use the same functions as above but add true as a last param
*/
$repeater_fields[] = $my_meta->addText('re_text_field_id', array('name' => 'My Text '), true);
$repeater_fields[] = $my_meta->addTextarea('re_textarea_field_id', array('name' => 'My Textarea '), true);
$repeater_fields[] = $my_meta->addCheckbox('re_checkbox_field_id', array('name' => 'My Checkbox '), true);
$repeater_fields[] = $my_meta->addImage('image_field_id', array('name' => 'My Image '), true);
/*
* Then just add the fields to the repeater block
*/
//repeater block
//$my_meta->addRepeaterBlock('re_',array('inline' => true, 'name' => 'This is a Repeater Block','fields' => $repeater_fields));
/*
* Don't Forget to Close up the meta box deceleration
*/
//Finish Taxonomy Extra fields Deceleration
$my_meta->Finish();
  * configure your meta box
  */
 $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
 /*
  * Initiate your meta box
  */
 $my_meta = new Tax_Meta_Class($config);
 /*
  * Add fields to your meta box
  */
 //text field
 // $my_meta->addText($prefix.'text_field_id',array('name'=> __('My Text ','tax-meta')));
 //textarea field
 // $my_meta->addTextarea($prefix.'textarea_field_id',array('name'=> __('My Textarea ','tax-meta')));
 //checkbox field
 $my_meta->addCheckbox($prefix . 'sidebar_state', array('name' => __('Turn on sidebar', 'tax-meta')));
 //select field
 // $my_meta->addSelect($prefix.'select_field_id',array('selectkey1'=>'Select Value1','selectkey2'=>'Select Value2'),array('name'=> __('My select ','tax-meta'), 'std'=> array('selectkey2')));
 //radio field
 // $my_meta->addRadio($prefix.'radio_field_id',array('radiokey1'=>'Radio Value1','radiokey2'=>'Radio Value2'),array('name'=> __('My Radio Filed','tax-meta'), 'std'=> array('radionkey2')));
 //date field
 // $my_meta->addDate($prefix.'date_field_id',array('name'=> __('My Date ','tax-meta')));
 //Time field
 // $my_meta->addTime($prefix.'time_field_id',array('name'=> __('My Time ','tax-meta')));
 //Color field
 // $my_meta->addColor($prefix.'color_field_id',array('name'=> __('My Color ','tax-meta')));
 //Image field
 // $my_meta->addImage($prefix.'image_field_id',array('name'=> __('My Image ','tax-meta')));
 //file upload field
 // $my_meta->addFile($prefix.'file_field_id',array('name'=> __('My File ','tax-meta')));
 //wysiwyg field
Ejemplo n.º 8
0
require_once get_template_directory() . '/framework/libs/tax-meta-class/Tax-meta-class.php';
if (is_admin()) {
    /*
     * prefix of meta keys, optional
     */
    $prefix = 'thim_';
    /*
     * configure your meta box
     */
    $config = array('id' => 'category_meta_box', 'title' => 'Category Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $my_meta = new Tax_Meta_Class($config);
    /*
     * Add fields to your meta box
     */
    $my_meta->addSelect($prefix . 'layout', array('' => 'Using in Theme Option', 'full-content' => 'No Sidebar', 'sidebar-left' => 'Left Sidebar', 'sidebar-right' => 'Right Sidebar'), array('name' => __('Custom Layout ', 'mabu'), 'std' => array('')));
    $my_meta->addSelect($prefix . 'custom_heading', array('' => 'Using in Theme Option', 'custom' => 'Custom'), array('name' => __('Custom Heading ', 'mabu'), 'std' => array('')));
    $my_meta->addImage($prefix . 'archive_top_image', array('name' => __('Background images Heading', 'mabu')));
    $my_meta->addColor($prefix . 'archive_cate_heading_bg_color', array('name' => __('Background Color Heading', 'mabu')));
    $my_meta->addColor($prefix . 'archive_cate_heading_text_color', array('name' => __('Text Color Heading', 'mabu')));
    $my_meta->addCheckbox($prefix . 'archive_cate_hide_title', array('name' => __('Hide Title', 'mabu')));
    $my_meta->Finish();
    /**
     * Custom Woocommerce Category Meta
     */
    $thim_wc_config = array('id' => 'woocommerce_meta_box', 'title' => 'Product Meta Box', 'pages' => array('product_cat'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $thim_wc_meta = new Tax_Meta_Class($thim_wc_config);
    $thim_wc_meta->addCheckbox($prefix . 'category_show_related_products', array('name' => __('Hide Related ', 'mabu'), 'desc' => __('Hide related products in single product', 'mabu')));
    $thim_wc_meta->addSelect($prefix . 'category_custom_columns', array('default' => 'Default', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => '10'), array('name' => __('Custom columns', 'mabu'), 'std' => array('default')));
    $thim_wc_meta->addtext($prefix . 'category_products_per_page', array('name' => __('Number of Products per Page', 'mabu'), 'std' => ''));
    $thim_wc_meta->Finish();
}
 function wipCustomTaxonomy()
 {
     if (is_admin()) {
         $includeTaxonomyMeta = array('category');
         // Array of taxonomy types to include the WIP custom taxonomy options
         $wipTaxonomy = get_taxonomies(array('public' => true, '_builtin' => false), 'objects');
         // Find custom taxonomies, see if they include the WIP custom taxonomy options
         if ($wipTaxonomy) {
             foreach ($wipTaxonomy as $wipTaxonomy_value) {
                 if (isset($wipTaxonomy_value->wip_taxonomy_options) && $wipTaxonomy_value->wip_taxonomy_options == true) {
                     array_push($includeTaxonomyMeta, $wipTaxonomy_value->name);
                 }
             }
         }
         // Custom fields for taxonomies
         $categoryMetaConfig = array('pages' => $includeTaxonomyMeta, 'use_with_theme' => true);
         $categoryMeta = new Tax_Meta_Class($categoryMetaConfig);
         $categoryMeta->addCheckbox('widget', array('name' => 'Widgetize', 'desc' => 'Add a widget area to the archive sidebar'));
         $categoryMeta->addCheckbox('widgetPost', array('name' => '', 'desc' => 'Extend the category widget area to its posts'));
         $categoryMeta->addCheckbox('magazine', array('name' => '', 'desc' => 'Digital magazine archive (displays sub-categories and posts therein)'));
         //$categoryMeta->addCheckbox( 'author', array( 'name'=> '', 'desc'=> 'Show post author on archive' ) );
         //$categoryMeta->addCheckbox( 'pubDate', array( 'name'=> '', 'desc'=> 'Show post publish date on archive' ) );
         //$categoryMeta->addCheckbox( 'taxonomy', array( 'name'=> '', 'desc'=> 'Show post categories and tags on archive' ) );
         //$categoryMeta->addCheckbox( 'comment', array( 'name'=> '', 'desc'=> 'Show number of comments per post on archive' ) );
         $categoryMeta->addText('navOverride', array('name' => 'Navigation Override', 'desc' => 'The URL of the navigation link to be set as current when viewing posts in this category'));
         $categoryMeta->addText('customCSS', array('name' => 'Custom CSS', 'desc' => 'The URL of a stylesheet to apply to posts in this category and its archive'));
         $categoryMeta->Finish();
     }
 }
Ejemplo n.º 10
0
 public static function metadata_customizations()
 {
     include_once PLS_Route::locate_blueprint_option('meta.php');
     //throws random errors if you aren't an admin, can't be loaded with admin_init...
     if (!is_admin() || !class_exists('Tax_Meta_Class')) {
         return;
     }
     $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('state', 'city', 'zip', 'street', 'neighborhood'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
     $my_meta = new Tax_Meta_Class($config);
     foreach (self::$custom_meta as $meta) {
         switch ($meta['type']) {
             case 'text':
                 $my_meta->addText($meta['id'], array('name' => $meta['label']));
                 break;
             case 'textarea':
                 $my_meta->addTextarea($meta['id'], array('name' => $meta['label']));
                 break;
             case 'wysiwyg':
                 $my_meta->addCheckbox($meta['id'], array('name' => $meta['label']));
                 break;
             case 'image':
                 $my_meta->addImage($meta['id'], array('name' => $meta['label']));
                 break;
             case 'file':
                 $my_meta->addFile($meta['id'], array('name' => $meta['label']));
                 break;
             case 'checkbox':
                 $my_meta->addCheckbox($meta['id'], array('name' => $meta['label']));
                 break;
         }
     }
     $my_meta->Finish();
 }
<?php

/***
* custom fields for taxonomies
* using tax-meta-class plugin
**/
/**
Field(s) for Cities
**/
if (is_admin()) {
    $prefix = 'nt_';
    /* 
     * configure meta box
     */
    $config = array('id' => 'location_info', 'title' => 'Location Information', 'pages' => array('city'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => false);
    $metabox = new Tax_Meta_Class($config);
    $metabox->addSelect($prefix . 'state-prov', array('' => 'Choose', 'AL' => 'Alabama', 'AK' => 'Alaska', 'AZ' => 'Arizona', 'AR' => 'Arkansas', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District Of Columbia', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'IA' => 'Iowa', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'ME' => 'Maine', 'MD' => 'Maryland', 'MA' => 'Massachusetts', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NE' => 'Nebraska', 'NV' => 'Nevada', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NY' => 'New York', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VT' => 'Vermont', 'VA' => 'Virginia', 'WA' => 'Washington', 'WV' => 'West Virginia', 'WI' => 'Wisconsin', 'WY' => 'Wyoming', 'AS' => 'American Samoa', 'GU' => 'Guam', 'MP' => 'Northern Mariana Islands', 'PR' => 'Puerto Rico', 'UM' => 'United States Minor Outlying Islands', 'VI' => 'Virgin Islands', 'AB' => 'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', 'NB' => 'New Brunswick', 'NL' => 'Newfoundland and Labrador', 'NS' => 'Nova Scotia', 'ON' => 'Ontario', 'PE' => 'Prince Edward Island', 'QC' => 'Quebec', 'SK' => 'Saskatchewan', 'NT' => 'Northwest Territories', 'NU' => 'Nunavut', 'YT' => 'Yukon'), array('name' => __('State/Province ', 'tax-meta'), 'std' => array('')));
    $metabox->addText($prefix . 'map_info', array('name' => __('Google Maps ', 'tax-meta'), 'desc' => 'Mapping info'));
    $metabox->addFile($prefix . 'city_img', array('name' => __('City Image ', 'tax-meta'), 'desc' => 'The image for the city'));
    $metabox->addCheckbox($prefix . 'feat_city', array('name' => __('Featured City ', 'tax-meta'), 'desc' => 'Featured city (y/n) (Shows up on home page)'));
    $metabox->Finish();
}
Ejemplo n.º 12
0
//include the main class file
require_once "functions/Tax-meta-class/Tax-meta-class.php";
if (is_admin()) {
    /*  prefix of meta keys, optional */
    $prefix = 'pego_';
    /* meta box configuration */
    $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    /* Initiate meta box */
    $my_meta = new Tax_Meta_Class($config);
    /* Adding fields to meta box  */
    //Category Color
    $my_meta->addColor($prefix . 'category_color', array('name' => __('Category color ', 'tax-meta')));
    //Category show
    $my_meta->addSelect($prefix . 'category_show_type', array('type1' => 'Type#1', 'type2' => 'Type#2'), array('name' => __('Category show type ', 'tax-meta'), 'std' => array('type1')));
    //latest post show
    $my_meta->addCheckbox($prefix . 'category_show_latest', array('name' => __('Show latest news ticker?', 'tax-meta')));
    //Featured post section
    $my_meta->addSelect($prefix . 'category_featured_post_section', array('none' => 'None', 'type1' => 'Type#1', 'type2' => 'Type#2', 'type3' => 'Type#3', 'type4' => 'Type#4', 'type5' => 'Type#5'), array('name' => __('Category Featured Post Section ', 'tax-meta'), 'std' => array('none')));
    //Post category pagination
    //$my_meta->addText($prefix.'category_pagination',array('name'=> 'Set number of posts where you want to start the pagination. If empty, default WordPress setting will be taken.'));
    //Sidebar select
    $allSidebarss = pego_get_all_sidebars();
    $my_meta->addSelect($prefix . 'category_sidebar', $allSidebarss, array('name' => __('Category sidebar ', 'tax-meta')));
    //Finish Meta Box Decleration
    $my_meta->Finish();
}
/***************************************************************  
Include php files
***************************************************************/
define('PEGO_FILEPATH', get_template_directory());
define('PEGO_DIRECTORY', get_template_directory_uri());
Ejemplo n.º 13
0
Author URI: http://en.bainternet.info
*/
if (is_admin()) {
    global $funky_shortname;
    /* 
     * prefix of meta keys, optional
     */
    $prefix = $funky_shortname;
    /* 
     * configure your meta box
     */
    $config = array('id' => 'portfolio-layout-options', 'title' => 'Portfolio Layout Options', 'pages' => array('portfolio_category', 'portfolio_tag'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => trailingslashit(get_template_directory_uri()) . 'inc/taxonomy_options');
    /*
     * Initiate your meta box
     */
    $my_meta = new Tax_Meta_Class($config);
    /*
     * Add fields to your meta box
     */
    // Thumbnail Style
    $my_meta->addSelect($prefix . '_portfolio_thumbnail_style', array('0' => __("Square", "funky_theme"), '1' => __("Landscape", "funky_theme"), '2' => __("Portrait", "funky_theme")), array('name' => __("Thumbnail Style", "funky_theme"), 'std' => array('0')));
    // Show Category Label
    $my_meta->addCheckbox($prefix . '_portfolio_category_label', array('name' => __("Show category label", "funky_theme")));
    // Show Social Share Buttons
    $my_meta->addCheckbox($prefix . '_portfolio_share_buttons', array('name' => __("Show social share buttons on portfolio items", "funky_theme")));
    /*
     * Don't Forget to Close up the meta box decleration
     */
    //Finish Meta Box Decleration
    $my_meta->Finish();
}