function add_location_type_meta() { /* * prefix of meta keys, optional */ $prefix = 'st_'; /* * configure your meta box */ $config = array('id' => 'st_extra_infomation', 'title' => __('Extra Information', ST_TEXTDOMAIN), 'pages' => array('st_location_type'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); if (!class_exists('Tax_Meta_Class')) { STFramework::write_log('Tax_Meta_Class not found in class.attribute.php line 121'); return; } /* * Initiate your meta box */ $my_meta = new Tax_Meta_Class($config); /* * Add fields to your meta box */ //text field $my_meta->addSelect($prefix . 'label', array('default' => __('Default', ST_TEXTDOMAIN), 'primary' => __('Primary', ST_TEXTDOMAIN), 'success' => __('Success', ST_TEXTDOMAIN), 'info' => __('Info', ST_TEXTDOMAIN), 'warning' => __('Warning', ST_TEXTDOMAIN), 'danger' => __('Danger', ST_TEXTDOMAIN)), array('name' => __('Label Type', ST_TEXTDOMAIN))); //Image field //$my_meta->addImage($prefix.'image',array('name'=> __('Image ',ST_TEXTDOMAIN), // 'desc'=>__('If dont like the icon, you can use image instead',ST_TEXTDOMAIN))); //file upload field /* * Don't Forget to Close up the meta box decleration */ //Finish Meta Box Decleration $my_meta->Finish(); }
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(); } }
*/ $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_schema', apply_filters('geodir_cat_schemas', array('' => __('Default (LocalBusiness)', 'geodirectory'), 'AccountingService' => 'AccountingService', 'Attorney' => 'Attorney', 'AutoBodyShop' => 'AutoBodyShop', 'AutoDealer' => 'AutoDealer', 'AutoPartsStore' => 'AutoPartsStore', 'AutoRental' => 'AutoRental', 'AutoRepair' => 'AutoRepair', 'AutoWash' => 'AutoWash', 'Bakery' => 'Bakery', 'BarOrPub' => 'BarOrPub', 'BeautySalon' => 'BeautySalon', 'BedAndBreakfast' => 'BedAndBreakfast', 'BikeStore' => 'BikeStore', 'BookStore' => 'BookStore', 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', 'ChildCare' => 'ChildCare', 'ClothingStore' => 'ClothingStore', 'ComputerStore' => 'ComputerStore', 'DaySpa' => 'DaySpa', 'Dentist' => 'Dentist', 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', 'Electrician' => 'Electrician', 'ElectronicsStore' => 'ElectronicsStore', 'EmergencyService' => 'EmergencyService', 'EntertainmentBusiness' => 'EntertainmentBusiness', 'Event' => 'Event', 'EventVenue' => 'EventVenue', 'ExerciseGym' => 'ExerciseGym', 'FinancialService' => 'FinancialService', 'Florist' => 'Florist', 'FoodEstablishment' => 'FoodEstablishment', 'FurnitureStore' => 'FurnitureStore', 'GardenStore' => 'GardenStore', 'GeneralContractor' => 'GeneralContractor', 'GolfCourse' => 'GolfCourse', 'HairSalon' => 'HairSalon', 'HardwareStore' => 'HardwareStore', 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', 'HobbyShop' => 'HobbyShop', 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', 'HomeGoodsStore' => 'HomeGoodsStore', 'Hospital' => 'Hospital', 'Hotel' => 'Hotel', 'HousePainter' => 'HousePainter', 'HVACBusiness' => 'HVACBusiness', 'InsuranceAgency' => 'InsuranceAgency', 'JewelryStore' => 'JewelryStore', 'LiquorStore' => 'LiquorStore', 'Locksmith' => 'Locksmith', 'LodgingBusiness' => 'LodgingBusiness', 'MedicalClinic' => 'MedicalClinic', 'MensClothingStore' => 'MensClothingStore', 'MobilePhoneStore' => 'MobilePhoneStore', 'Motel' => 'Motel', 'MotorcycleDealer' => 'MotorcycleDealer', 'MotorcycleRepair' => 'MotorcycleRepair', 'MovingCompany' => 'MovingCompany', 'MusicStore' => 'MusicStore', 'NailSalon' => 'NailSalon', 'NightClub' => 'NightClub', 'Notary' => 'Notary', 'OfficeEquipmentStore' => 'OfficeEquipmentStore', 'Optician' => 'Optician', 'PetStore' => 'PetStore', 'Physician' => 'Physician', 'Plumber' => 'Plumber', 'ProfessionalService' => 'ProfessionalService', 'RealEstateAgent' => 'RealEstateAgent', 'Residence' => 'Residence', 'Restaurant' => 'Restaurant', 'RoofingContractor' => 'RoofingContractor', 'RVPark' => 'RVPark', 'School' => 'School', 'SelfStorage' => 'SelfStorage', 'ShoeStore' => 'ShoeStore', 'SkiResort' => 'SkiResort', 'SportingGoodsStore' => 'SportingGoodsStore', 'SportsClub' => 'SportsClub', 'Store' => 'Store', 'TattooParlor' => 'TattooParlor', 'Taxi' => 'Taxi', 'TennisComplex' => 'TennisComplex', 'TireShop' => 'TireShop', 'TouristAttraction' => 'TouristAttraction', 'ToyStore' => 'ToyStore', 'TravelAgency' => 'TravelAgency', 'VeterinaryCare' => 'VeterinaryCare', 'WholesaleStore' => 'WholesaleStore', 'Winery' => 'Winery')), array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); /*$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 /* if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){ // Exclude sort options $my_meta->addCheckbox($prefix.'cat_exclude_rating',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'))); $my_meta->addCheckbox($prefix.'cat_exclude_reviews',array('name'=> __('<b>Exclude</b> Reviews sort option','geodirectory')));
<?php require_once "Tax-meta-class.php"; if (is_admin()) { $prefix = 'bpxl_'; $config = array('id' => 'bpxl_cat_meta_box', 'title' => 'BloomPixel 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 */ // Category Primary Color $my_meta->addColor($prefix . 'color_field_id', array('name' => __('Category Primary Color ', 'tax-meta'))); // Background Image $my_meta->addImage($prefix . 'bg_field_id', array('name' => __('Background Image ', 'tax-meta'))); // Background Repeat $my_meta->addSelect($prefix . 'category_repeat_id', array('repeat' => 'Repeat', 'no-repeat' => 'No Repeat'), array('name' => __('Background Repeat ', 'tax-meta'), 'std' => array('repeat'))); // Background Attachment $my_meta->addSelect($prefix . 'background_attachment_id', array('fixed' => 'Fixed', 'scroll' => 'Scroll'), array('name' => __('Background Attachment ', 'tax-meta'), 'std' => array('repeat'))); // Background Position $my_meta->addSelect($prefix . 'background_position_id', array('center' => 'Center', 'bottom' => 'Bottom', 'left' => 'Left', 'top' => 'Top'), array('name' => __('Background Position ', 'tax-meta'), 'std' => array('repeat'))); $my_meta->Finish(); }
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(); }
<?php if (!function_exists('cf_rotator')) { function cf_rotator() { $labels = array('name' => _x('Rotators', 'Post Type General Name', 'cf'), 'singular_name' => _x('Rotator', 'Post Type Singular Name', 'cf'), 'menu_name' => __('Rotators', 'cf'), 'parent_item_colon' => __('Parent Rotator:', 'cf'), 'all_items' => __('All Rotators', 'cf'), 'view_item' => __('View Rotator', 'cf'), 'add_new_item' => __('Add New Rotator', 'cf'), 'add_new' => __('Add New', 'cf'), 'edit_item' => __('Edit Rotator', 'cf'), 'update_item' => __('Update Rotator', 'cf'), 'search_items' => __('Search Rotators', 'cf'), 'not_found' => __('Not found', 'cf'), 'not_found_in_trash' => __('Not found in Trash', 'cf')); $args = array('label' => __('rotator', 'cf'), 'description' => __('Content Rotators', 'cf'), 'labels' => $labels, 'supports' => array('title', 'editor', 'thumbnail'), 'taxonomies' => array('group'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 22, 'menu_icon' => 'dashicons-slides', 'can_export' => false, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => true, 'capability_type' => 'page'); register_post_type('rotator', $args); } add_action('init', 'cf_rotator', 0); } if (!function_exists('cf_rotator_groups')) { function cf_rotator_groups() { $labels = array('name' => _x('Groups', 'Taxonomy General Name', 'cf'), 'singular_name' => _x('Group', 'Taxonomy Singular Name', 'cf'), 'menu_name' => __('Group', 'cf'), 'all_items' => __('All Groups', 'cf'), 'parent_item' => __('Parent Group', 'cf'), 'parent_item_colon' => __('Parent Group:', 'cf'), 'new_item_name' => __('New Group Name', 'cf'), 'add_new_item' => __('Add New Group', 'cf'), 'edit_item' => __('Edit Group', 'cf'), 'update_item' => __('Update Group', 'cf'), 'separate_items_with_commas' => __('Separate groups with commas', 'cf'), 'search_items' => __('Search Groups', 'cf'), 'add_or_remove_items' => __('Add or remove groups', 'cf'), 'choose_from_most_used' => __('Choose from the most used groups', 'cf'), 'not_found' => __('Not Found', 'cf')); $args = array('labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false); register_taxonomy('group', array('rotator'), $args); } add_action('init', 'cf_rotator_groups', 0); } $config = array('id' => 'cf_rotator_meta', 'title' => 'Rotator Meta Box', 'pages' => array('group'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $cf_rotator = new Tax_Meta_Class($config); $cf_rotator->addSelect('mode', array('horizontal' => 'Horizontal', 'vertical' => 'Vertical', 'fade' => 'Fade'), array('name' => 'Transition Mode', 'std' => array('horizontal'))); $cf_rotator->addText('speed', array('name' => 'Transition Speed', 'std' => '500', 'desc' => 'Type of transition between slides.')); $cf_rotator->addRadio('loop', array('true' => 'True', 'false' => 'False'), array('name' => 'Infinite Loop', 'std' => array('true'))); $cf_rotator->addRadio('captions', array('true' => 'True', 'false' => 'False'), array('name' => 'Include Captions', 'std' => array('false'))); $cf_rotator->addRadio('ticker', array('true' => 'True', 'false' => 'False'), array('name' => 'Ticker Style', 'std' => array('false'))); $cf_rotator->addRadio('video', array('true' => 'True', 'false' => 'False'), array('name' => 'Include Video', 'std' => array('false'))); $cf_rotator->Finish();
$sidebars[strtolower($sidebar)] = $sidebar; } } } $sidebarSmall = array(); $sidebarSmall['off'] = 'Disabled'; $sidebarSmall['default'] = 'Default'; if (!empty($sidebar_names)) { foreach ($sidebar_names as $sidebar) { if ($sidebar != "") { $sidebarSmall[strtolower($sidebar)] = $sidebar; } } } $my_meta = new Tax_Meta_Class($config); $my_meta->addSelect(THEME_NAME . '_sidebar_select', $sidebars, array('name' => __('Sidebar', 'tax-meta'), 'std' => array('default'))); $my_meta->addSelect(THEME_NAME . '_sidebar_position', array('right' => 'Right', 'left' => 'Left'), array('name' => __('Main Sidebar Position ', 'tax-meta'), 'std' => array('right'))); $my_meta->addSelect(THEME_NAME . '_blog_style', array('1' => __('Small Images', THEME_NAME), '2' => __('Large Images', THEME_NAME)), array('name' => __('Category Style ', 'category'), 'std' => array('1'))); $my_meta->Finish(); /* -------------------------------------------------------------------------* * GET META VALUE OUTSIDE THE LOOP * * -------------------------------------------------------------------------*/ function ot_meta($value, $id) { $meta = get_post_meta($value, $id, true); return $meta; } /* -------------------------------------------------------------------------* * GET IMAGE HTML * * -------------------------------------------------------------------------*/ function ot_image_html($id, $width = 0, $height = 0, $class = false)
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(); }
Meta boxes for post categories ***************************************************************/ //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 ***************************************************************/
<?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(); }
<?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' => 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', 'style-d' => 'Blog Style D'), array('name' => __('Blog Style ', 'tax-meta'), 'std' => array('style-a'))); $cb_cat_meta->addColor($prefix . 'color_field_id', array('name' => __('Category Global Color', 'tax-meta'))); $cb_cat_meta->addSelect($prefix . 'cat_featured_op', array('Off' => 'Off', 'full-slider' => 'Full-width Slider', 'slider' => 'Slider', 'grid-4' => 'Grid - 4', 'grid-5' => 'Grid - 5', 'grid-6' => 'Grid - 6'), array('name' => __('Show grid/slider ', 'tax-meta'), 'std' => array('Off'))); $cb_cat_meta->addSelect($prefix . 'cat_sidebar', array('off' => 'Off', 'on' => 'On'), array('name' => __('Custom Sidebar ', 'tax-meta'), 'std' => array('off'))); $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' => 'Full-Width Stretch', '2' => 'Repeat', '3' => 'No-Repeat'), array('name' => __('Background Image Settings', 'tax-meta'), 'std' => array('1'))); $cb_cat_meta->addColor($prefix . 'bg_color_field_id', array('name' => __('Category Background Color', 'tax-meta'))); $cb_cat_meta->Finish(); }
$prefix = 's3bubble_'; /* * configure your meta box */ $config = array('id' => 's3bubble_course_meta_box', 'title' => 'S3Bubble Course Meta', '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 . 'extra_cat_meta_text', array('name' => __('Course Title', 'tax-meta'), 'desc' => 'this is a field desription')); //select field $my_meta->addSelect($prefix . 'extra_cat_meta_level', array('Beginner' => 'Beginner', 'Intermediate' => 'Intermediate', 'Advanced' => 'Advanced'), array('name' => 'Level', 'std' => array('selectkey3'))); //Image field $my_meta->addImage($prefix . 'extra_cat_meta_image', array('name' => __('Course Image', 'tax-meta'))); /* * Don't Forget to Close up the meta box decleration */ //Finish Meta Box Decleration $my_meta->Finish(); } //get term meta field function get_tax_meta_s3bubble($term_id, $key, $multi = false) { $t_id = is_object($term_id) ? $term_id->term_id : $term_id; $m = get_option('tax_meta_' . $t_id); if (isset($m[$key])) { return $m[$key];
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(); }
//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 //Category title type // $my_meta->addSelect($prefix.'category_title_type',array('type1'=>'Type#1','type2'=>'Type#2', 'type3'=>'Type#3'),array('name'=> __('Category title type ','tax-meta'), 'std'=> array('none'))); //Featured post section // $my_meta->addSelect($prefix.'category_post_section_type',array('none'=>'None', 'type1'=>'Type#1','type2'=>'Type#2', 'type3'=>'Type#3', 'type4'=>'Type#4', 'type5'=>'Type#5', 'type6'=>'Type#6', 'type7'=>'Type#7'),array('name'=> __('Category post section type ','tax-meta'), 'std'=> array('none'))); //latest post show //$my_meta->addCheckbox($prefix.'category_show_latest',array('name'=> __('Show latest news ticker?','tax-meta'))); //Post category title image $my_meta->addText($prefix . 'category_title_image', array('name' => 'Enter url for the category title image.')); //Sidebar select $allSidebarss = pego_get_all_sidebars1(); $my_meta->addSelect($prefix . 'category_sidebar', $allSidebarss, array('name' => __('Category sidebar ', 'tax-meta'))); //Finish Meta Box Decleration $my_meta->Finish(); } /*************************************************************** Menu customization ***************************************************************/ class pego_description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { global $wp_query; $indent = $depth ? str_repeat("\t", $depth) : ''; $class_names = $value = ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));
$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 $my_meta->addWysiwyg($prefix . 'wysiwyg_field_id', array('name' => __('My wysiwyg Editor ', 'tax-meta'))); //taxonomy field
<?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(); }