function wp_ccp_plugin_admin_init()
{
    if (is_admin()) {
        $config = array('id' => 'wp_ccp_plugin_category_meta', 'title' => 'Custom Category Meta', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => false);
        $my_meta = new Tax_Meta_Class($config);
        $my_meta->addSelect('custom_content_enabled', array('1' => __('Yes', 'wp_ccp_plugin'), '0' => __('No', 'wp_ccp_plugin')), array('name' => __('Use Custom Category Pages content for this category?', 'wp_ccp_plugin'), 'std' => array('0')));
        $my_meta->addText('heading', array('name' => __('Category Headline', 'wp_ccp_plugin')));
        $my_meta->addText('page_title', array('name' => __('Category Page Title', 'wp_ccp_plugin')));
        $my_meta->addWysiwyg('copy', array('name' => __('Category Copy', 'wp_ccp_plugin')));
        $my_meta->Finish();
    }
}
Beispiel #2
0
 //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
 $my_meta->addWysiwyg($prefix . 'wysiwyg_field_id', array('name' => __('My wysiwyg Editor ', 'tax-meta')));
 //taxonomy field
 $my_meta->addTaxonomy($prefix . 'taxonomy_field_id', array('taxonomy' => 'category'), array('name' => __('My Taxonomy ', 'tax-meta')));
 //posts field
 $my_meta->addPosts($prefix . 'posts_field_id', array('args' => array('post_type' => 'page')), array('name' => __('My Posts ', 'tax-meta')));
 /*
  * 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($prefix . 're_text_field_id', array('name' => __('My Text ', 'tax-meta')), true);
 $repeater_fields[] = $my_meta->addTextarea($prefix . 're_textarea_field_id', array('name' => __('My Textarea ', 'tax-meta')), true);
 $repeater_fields[] = $my_meta->addCheckbox($prefix . 're_checkbox_field_id', array('name' => __('My Checkbox ', 'tax-meta')), true);
 $repeater_fields[] = $my_meta->addImage($prefix . 'image_field_id', array('name' => __('My Image ', 'tax-meta')), true);
 /*
  * Then just add the fields to the repeater block
  */
Beispiel #3
0
 /*
  * prefix of meta keys, optional
  * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_';
  *  you also can make prefix empty to disable it
  *
  */
 $prefix = 'ct_';
 /*
  * configure your meta box
  */
 $config = array('id' => 'demo_meta_box', 'title' => __('Demo Meta Box', 'geodirectory'), 'pages' => geodir_get_taxonomies(), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
 /*
  * Initiate your meta box
  */
 $my_meta = new Tax_Meta_Class($config);
 $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
 $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
 $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
 /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/
 // hidden setting to trick WPML
 /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'),
   'random'=>__('Random','geodirectory'),
   'az'=>__('Alphabetical' , 'geodirectory'),
   'newest'=>__('Newest','geodirectory'),
   'oldest'=>__('Oldest','geodirectory'),
   'high_rating'=>__('Highest Rating','geodirectory'),
   'low_rating'=>__('Lowest Rating','geodirectory'),
   'high_review'=>__('Highest Reviews','geodirectory'),
   'low_review'=>__('Lowest Reviews','geodirectory')),
   array('name'=> __('Sort By','geodirectory'),'desc' => __('Select the default sort option.' ,'geodirectory'), 'std'=> array('selectkey2')));*/
 // Show options for placecategories only
Beispiel #4
0
    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);
}
require_once 'lib/wp_bootstrap_navwalker.php';
* configure taxonomy custom fields
*/
$config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('department', 'location'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
/*
* 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
 //select field
 $my_meta->addSelect($prefix . 'select_field_id', array('selectkey1' => 'Select Value1', 'selectkey2' => 'Select Value2'), array('name' => 'My select ', 'std' => array('selectkey2')));
 //radio field
 $my_meta->addRadio($prefix . 'radio_field_id', array('radiokey1' => 'Radio Value1', 'radiokey2' => 'Radio Value2'), array('name' => 'My Radio Filed', 'std' => array('radionkey2')));
 //date field
 $my_meta->addDate($prefix . 'date_field_id', array('name' => 'My Date '));
 //Time field
 $my_meta->addTime($prefix . 'time_field_id', array('name' => 'My Time '));
 //Color field
 $my_meta->addColor($prefix . 'color_field_id', array('name' => 'My Color '));
 //Image field
 $my_meta->addImage($prefix . 'image_field_id', array('name' => 'My Image '));
 //file upload field
 $my_meta->addFile($prefix . 'file_field_id', array('name' => 'My File '));
 //wysiwyg field
 $my_meta->addWysiwyg($prefix . 'wysiwyg_field_id', array('name' => 'My wysiwyg Editor '));
 //taxonomy field
 $my_meta->addTaxonomy($prefix . 'taxonomy_field_id', array('taxonomy' => 'category'), array('name' => 'My Taxonomy '));
 //posts field
 $my_meta->addPosts($prefix . 'posts_field_id', array('args' => array('post_type' => 'page')), array('name' => 'My Posts '));
 /*
  * 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($prefix . 're_text_field_id', array('name' => 'My Text '), true);
 $repeater_fields[] = $my_meta->addTextarea($prefix . 're_textarea_field_id', array('name' => 'My Textarea '), true);
 $repeater_fields[] = $my_meta->addCheckbox($prefix . 're_checkbox_field_id', array('name' => 'My Checkbox '), true);
 $repeater_fields[] = $my_meta->addImage($prefix . 'image_field_id', array('name' => 'My Image '), true);
 /*
  * Then just add the fields to the repeater block
  */
<?php

require_once 'Tax-meta-class.php';
if (is_admin()) {
    $prefix = 'cb_';
    $config = array('id' => 'cb_cat_meta', 'title' => 'Category Extra Meta', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    $cb_cat_meta = new Tax_Meta_Class($config);
    $cb_cat_meta->addSelect($prefix . 'cat_style_field_id', array('1' => 'One post per line', '2' => 'Two posts per line', '3' => 'Three posts per line'), array('name' => __('Post Layout ', 'tax-meta'), 'std' => array('2')));
    $cb_cat_meta->addSelect($prefix . 'cat_infinite', array('off' => 'Number Pagination', 'infinite-scroll' => 'Infinite Scroll', 'infinite-load' => 'Infinite Scroll With Load More Button'), array('name' => __('Pagination Style', 'tax-meta'), 'std' => array('Number Pagination')));
    $cb_cat_meta->addImage($prefix . 'bg_image_field_id', array('name' => __('Category Cover Image ', 'tax-meta')));
    $cb_cat_meta->addWysiwyg($prefix . 'cat_ad', array('name' => __('Category Ad', 'tax-meta')));
    $cb_cat_meta->Finish();
    $config = array('id' => 'cb_tag_meta', 'title' => 'Tags Extra Meta', 'pages' => array('post_tag'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    $cb_tag_meta = new Tax_Meta_Class($config);
    $cb_tag_meta->addSelect($prefix . 'cat_infinite', array('off' => 'Number Pagination', 'infinite-scroll' => 'Infinite Scroll', 'infinite-load' => 'Infinite Scroll With Load More Button'), array('name' => __('Pagination Style', 'tax-meta'), 'std' => array('Number Pagination')));
    $cb_tag_meta->addImage($prefix . 'bg_image_field_id', array('name' => __('Tag Cover Image ', 'tax-meta')));
    $cb_tag_meta->addWysiwyg($prefix . 'cat_ad', array('name' => __('Advertisement', 'tax-meta')));
    $cb_tag_meta->Finish();
}
require_once "Tax-meta-class.php";
if (is_admin()) {
    $prefix = 'cb_';
    $config = array('id' => 'cb_cat_meta', 'title' => 'Category Extra Meta', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $cb_cat_meta = new Tax_Meta_Class($config);
    $cb_cat_meta->addSelect($prefix . 'cat_style_field_id', array('style-a' => 'Blog Style A', 'style-b' => 'Blog Style B', 'style-c' => 'Blog Style C (No sidebar)', 'style-d' => 'Blog Style D', 'style-e' => 'Blog Style E', 'style-f' => 'Combo A + D', 'style-g' => 'Combo B + D', 'style-h' => 'Blog Style Grid', 'style-i' => 'Blog Style Grid (No sidebar)'), array('name' => __('Blog Style ', 'tax-meta'), 'std' => array('style-a')));
    $cb_cat_meta->addSelect($prefix . 'cat_infinite', array('cb-off' => 'Number Pagination', 'infinite-scroll' => 'Infinite Scroll', 'infinite-load' => 'Infinite Scroll With Load More Button'), array('name' => 'Infinite Scroll', 'std' => array('cb-off')));
    $cb_cat_meta->addColor($prefix . 'color_field_id', array('name' => __('Category Global Color', 'tax-meta'), 'desc' => 'This color is used on menu hover and review colors. '));
    $cb_cat_meta->addSelect($prefix . 'cat_featured_op', array('Off' => 'Off', 's-1fw' => 'Full-screen Slider (1 post)', 's-1' => 'Full-Width Slider (1 post)', 's-2' => 'Slider (2 Posts)', 's-3' => 'Full-Width Slider (3 Posts)', 'grid-3' => 'Grid - 3', 'grid-4' => 'Grid - 4', 'grid-5' => 'Grid - 5', 'grid-6' => 'Grid - 6'), array('name' => 'Show grid or slider ', 'std' => array('Off'), 'desc' => 'Show a grid or slider of posts above the blog style posts list on the category page.'));
    $cb_cat_meta->addSelect($prefix . 'cat_offset', array('on' => 'On', 'off' => 'Off'), array('name' => __('Offset Posts ', 'tax-meta'), 'std' => array('on'), 'desc' => 'This option will offset the posts so you do not have duplicate posts in the grid + blog list below.'));
    $cb_cat_meta->addSelect($prefix . 'cat_sidebar', array('off' => 'Off', 'on' => 'On'), array('name' => __('Custom Sidebar ', 'tax-meta'), 'std' => array('off'), 'desc' => 'This option allows you to use a unique sidebar for this category, when enabled, you will find a new sidebar area with the category name in Appearance -> Widgets.'));
    $cb_cat_meta->addSelect($prefix . 'cat_sidebar_location', array('sidebar' => 'Right', 'sidebar_left' => 'Left'), array('name' => __('Sidebar Location', 'tax-meta'), 'std' => array('cb-sidebar-right'), 'desc' => 'This option allows you to put the sidebar on the category page on the left or right (only applies on blog styles with sidebars).'));
    $cb_cat_meta->addImage($prefix . 'bg_image_field_id', array('name' => __('Category Background Image ', 'tax-meta')));
    $cb_cat_meta->addSelect($prefix . 'bg_image_setting_op', array('1' => 'Fit Screen', '2' => 'Repeat', '3' => 'No-Repeat'), array('name' => 'Background Image Settings', 'std' => array('1')));
    $cb_cat_meta->addColor($prefix . 'bg_color_field_id', array('name' => __('Category Background Color', 'tax-meta')));
    $cb_cat_meta->addWysiwyg($prefix . 'cat_ad', array('name' => __('Category Ad', 'tax-meta')));
    $cb_cat_meta->Finish();
    $config = array('id' => 'cb_tag_meta', 'title' => 'Tags Extra Meta', 'pages' => array('post_tag'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $cb_tag_meta = new Tax_Meta_Class($config);
    $cb_tag_meta->addSelect($prefix . 'cat_style_field_id', array('style-a' => 'Blog Style A', 'style-b' => 'Blog Style B', 'style-c' => 'Blog Style C (No sidebar)', 'style-d' => 'Blog Style D', 'style-e' => 'Blog Style E', 'style-f' => 'Combo A + D', 'style-g' => 'Combo B + D', 'style-h' => 'Blog Style Grid', 'style-i' => 'Blog Style Grid (No sidebar)'), array('name' => __('Blog Style ', 'tax-meta'), 'std' => array('style-a')));
    $cb_tag_meta->addSelect($prefix . 'cat_style_color', array('cb-light-blog' => 'Light', 'cb-dark-blog' => 'Dark'), array('name' => __('Blog Style Colors ', 'tax-meta'), 'std' => array('cb-light-blog')));
    $cb_tag_meta->addSelect($prefix . 'cat_infinite', array('cb-off' => 'Number Pagination', 'infinite-scroll' => 'Infinite Scroll', 'infinite-load' => 'Infinite Scroll With Load More Button'), array('name' => 'Infinite Scroll', 'std' => array('cb-off')));
    $cb_tag_meta->addSelect($prefix . 'cat_featured_op', array('Off' => 'Off', 's-1fw' => 'Full-screen Slider (1 post)', 's-1' => 'Full-Width Slider (1 post)', 's-2' => 'Slider (2 Posts)', 's-3' => 'Full-Width Slider (3 Posts)', 'grid-3' => 'Grid - 3', 'grid-4' => 'Grid - 4', 'grid-5' => 'Grid - 5', 'grid-6' => 'Grid - 6'), array('name' => 'Show grid or slider ', 'std' => array('Off'), 'desc' => 'Show a grid or slider of posts above the blog style posts list on the tag page.'));
    $cb_tag_meta->addSelect($prefix . 'cat_offset', array('on' => 'On', 'off' => 'Off'), array('name' => __('Offset Posts ', 'tax-meta'), 'std' => array('on'), 'desc' => 'This option will offset the posts so you do not have duplicate posts in the grid + blog list below.'));
    $cb_tag_meta->addImage($prefix . 'bg_image_field_id', array('name' => __('Tag Background Image ', 'tax-meta')));
    $cb_tag_meta->addSelect($prefix . 'bg_image_setting_op', array('1' => 'Full-Width Stretch', '2' => 'Repeat', '3' => 'No-Repeat'), array('name' => __('Background Image Settings', 'tax-meta'), 'std' => array('1')));
    $cb_tag_meta->addColor($prefix . 'bg_color_field_id', array('name' => __('Tag Background Color', 'tax-meta')));
    $cb_tag_meta->addWysiwyg($prefix . 'cat_ad', array('name' => __('Tag Ad', 'tax-meta')));
    $cb_tag_meta->Finish();
}
     */
    $mango_meta = new Tax_Meta_Class($config2);
    /*
     * Add fields to your meta box
     */
    //radio field
    $mango_meta->addRadio($prefix . 'taxonomy_layout', array('default' => __('Default Layout', 'mango'), 'left' => __('Left Sidebar', 'mango'), 'right' => __('Right Sidebar', 'mango'), 'both' => __('Both Sidebar', 'mango'), 'no' => __('Full Width', 'mango')), array('name' => __('Page Layout', 'mango'), 'std' => array('default')));
    $wp_registered_sidebar = wp_get_sidebars_widgets();
    $mango_sidebar[] = __("Default", 'mango');
    foreach ($wp_registered_sidebar as $sidebar => $sidebar_info) {
        if ($sidebar == 'wp_inactive_widgets') {
            continue;
        }
        $mango_sidebar[$sidebar] = ucwords(str_replace(array('_', '-'), ' ', $sidebar));
    }
    $mango_meta->addSelect($prefix . 'taxonomy_left_sidebar', $mango_sidebar, array('name' => __('Left Sidebar', 'mango')));
    $mango_meta->addSelect($prefix . 'taxonomy_right_sidebar', $mango_sidebar, array('name' => __('Right Sidebar', 'mango')));
    $mango_meta->addRadio($prefix . 'taxonomy_banner_type', array('' => __('No Banner', 'mango'), 'image' => __('Image', 'mango'), 'video' => __('Video', 'mango'), 'rev_slider' => __('Revolution Slider', 'mango'), 'custom_banner' => __('Custom Banner', 'mango')), array('name' => __('Banner Type', 'mango'), 'std' => array('')));
    //Image field
    $mango_meta->addImage($prefix . 'taxonomy_banner_image', array('name' => __('Banner Image ', 'mango'), 'desc' => __('Only useful when the banner type is Image', 'mango'), 'height' => '400px'));
    //text field
    $mango_meta->addText($prefix . 'taxonomy_banner_video', array('name' => __('Banner video URL', 'mango'), 'validate_func' => "mango_validate_url", 'style' => 'width: 100% !important;', 'desc' => __('Only useful when the banner type is Video. Add a valid flash video url like: youtube, vimeo, dailymotion etc. If you put an invalid url the data will not be saved.', 'mango')));
    $mango_meta->addSelect($prefix . 'taxonomy_banner_rev_slider', mango_get_rev_sliders(), array('name' => __('Banner Revolution Slider', 'mango'), 'desc' => __('Only useful when the banner type is Revolution Slider.', 'mango')));
    //wysiwyg field
    $mango_meta->addWysiwyg($prefix . 'taxonomy_banner_custom', array('name' => __('Custom Banner', 'mango'), 'desc' => __("Add custom banner from this editor", 'mango')));
    /* Don't Forget to Close up the meta box decleration
     */
    //Finish Meta Box Decleration
    $mango_meta->Finish();
    $mango_product_meta->Finish();
}
Beispiel #10
0
 /*
  * prefix of meta keys, optional
  * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_';
  *  you also can make prefix empty to disable it
  *
  */
 $prefix = 'ct_';
 /*
  * configure your meta box
  */
 $config = array('id' => 'demo_meta_box', 'title' => __('Demo Meta Box', GEODIRECTORY_TEXTDOMAIN), 'pages' => geodir_get_taxonomies(), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
 /*
  * Initiate your meta box
  */
 $my_meta = new Tax_Meta_Class($config);
 $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', GEODIRECTORY_TEXTDOMAIN), 'desc' => __('This will appear at the top of the category listing.', GEODIRECTORY_TEXTDOMAIN)));
 $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', GEODIRECTORY_TEXTDOMAIN), 'desc' => __('Choose a default "no image"', GEODIRECTORY_TEXTDOMAIN)));
 $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', GEODIRECTORY_TEXTDOMAIN), 'desc' => __('Choose a category icon', GEODIRECTORY_TEXTDOMAIN), 'validate_func' => '!empty'));
 /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option',GEODIRECTORY_TEXTDOMAIN),'style'=>'hidden'));*/
 // hidden setting to trick WPML
 /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , GEODIRECTORY_TEXTDOMAIN),
   'random'=>__('Random',GEODIRECTORY_TEXTDOMAIN),
   'az'=>__('Alphabetical' , GEODIRECTORY_TEXTDOMAIN),
   'newest'=>__('Newest',GEODIRECTORY_TEXTDOMAIN),
   'oldest'=>__('Oldest',GEODIRECTORY_TEXTDOMAIN),
   'high_rating'=>__('Highest Rating',GEODIRECTORY_TEXTDOMAIN),
   'low_rating'=>__('Lowest Rating',GEODIRECTORY_TEXTDOMAIN),
   'high_review'=>__('Highest Reviews',GEODIRECTORY_TEXTDOMAIN),
   'low_review'=>__('Lowest Reviews',GEODIRECTORY_TEXTDOMAIN)),
   array('name'=> __('Sort By',GEODIRECTORY_TEXTDOMAIN),'desc' => __('Select the default sort option.' ,GEODIRECTORY_TEXTDOMAIN), 'std'=> array('selectkey2')));*/
 // Show options for placecategories only