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(); } }
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(); }
public function add_tax_groups_meta_box() { $config = array('id' => $this->netevl_libtools->create_id(array($this->postType, 'taxonomy_metabox')), 'title' => 'Nastavení', 'pages' => array('judikatura-zakony'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); $this_tax_meta = new Tax_Meta_Class($config); $this_tax_meta->addText($this->netevl_libtools->create_id(array($this->postType, 'cislo_zakona')), array('name' => 'Číslo zákona')); $this_tax_meta->addText($this->netevl_libtools->create_id(array($this->postType, 'odkaz')), array('name' => 'Odkaz')); $this_tax_meta->Finish(); }
function smamo_register_case_type() { $labels = array('name' => _x('Cases', 'taxonomy general name'), 'singular_name' => _x('Type', 'taxonomy singular name'), 'search_items' => __('Søg i Typer'), 'all_items' => __('Alle Typer'), 'parent_item' => __('Forælder'), 'parent_item_colon' => __('Forælder:'), 'edit_item' => __('Rediger type'), 'update_item' => __('Opdater type'), 'add_new_item' => __('Tilføj nytype'), 'new_item_name' => __('Nytype'), 'menu_name' => __('Typer')); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'cases')); register_taxonomy('cases', array('case'), $args); if (class_exists('Tax_Meta_Class')) { $case_type_img = new Tax_Meta_Class(array('id' => 'case_type_img_upload', 'title' => 'Billede', 'pages' => array('cases'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false)); $case_type_img->addImage('case_type_img', array('name' => __('Billede', 'smamo'))); $case_type_img->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(); } }
/* Plugin Name: Demo Tax meta class Plugin URI: http://en.bainternet.info Description: Tax meta class usage demo Version: 2.0.2 Author: Bainternet, Ohad Raz Author URI: http://en.bainternet.info */ //include the main class file require_once "Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { /* * prefix of meta keys, optional */ $prefix = 'kt_'; /* * configure your meta box */ $config = array('id' => 'kt_meta_box', 'title' => 'Kute Meta Box', 'pages' => array('product_cat'), '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 */ //Image field $my_meta->addImage($prefix . 'category_slider', array('name' => __('Category slider', 'kutetheme'), 'multiple' => 'multiFile')); //Finish Meta Box Decleration $my_meta->Finish(); }
if (is_admin()) { /* * 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')));*/
<?php //include the main class file // 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();
/* Plugin Name: KDESC Plugin URI: https://github.com/b9sk/kdesc Description: Adding keywords field for tag and category taxonomies. Rewrite title-tag. Output META description and META keywords to HEAD. Version: 0.4 Author: Your mom License: Free */ /** * Дополнительные поля keywords, description, title для tag и category */ require_once "Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { $kdesc_config = array('id' => 'kdesc_keywords_meta_box', 'title' => 'Add Keywords', 'pages' => array('category', 'post_tag'), 'context' => 'normal', 'fields' => array(), 'use_with_theme' => false); $kdesc_field = new Tax_Meta_Class($kdesc_config); $kdesc_field->addText('m_kdesc_keywords', array('name' => __('Meta Keywords', 'tax-meta'), 'desc' => 'Custom keywords for this taxonomy.')); $kdesc_field->addText('m_kdesc_description', array('name' => __('Meta Description', 'tax-meta'), 'desc' => 'Custom description for this taxonomy.')); $kdesc_field->addText('m_kdesc_title', array('name' => __('Custom title', 'tax-meta'), 'desc' => 'Rewrite title-tag.')); $kdesc_field->Finish(); } /** * Вывод keywords и description */ function kdesc_add_meta($name, $content) { if ($content) { echo '<meta name="' . $name . '" itemprop="' . $name . '" content="' . $content . '">'; } } add_action('wp_head_add_meta', 'kdesc_add_meta', 10, 2);
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(); } }
//include the main class file require_once "Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { /* * prefix of meta keys, optional */ $prefix = 'pcomm_'; /* * 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')));
$cols['triangle_post_thumb'] = __('Image Preview'); return $cols; } /** * Include file for making custom fields for custom taxonomies #1 */ require_once 'Tax-meta-class/Tax-meta-class.php'; if (is_admin()) { /** * lets make this happen -define my new meta box options #2 */ $config = array('id' => 'featured_image_metabox', 'title' => 'Tile Image', 'pages' => array('phototype'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true); /** * name the metabox #3 */ $tax_metabox = new Tax_Meta_Class($config); /** * Add image field to metabox #4 */ $tax_metabox->addImage('featured_image_metabox', array('name' => 'My Image ')); $tax_metabox->Finish(); add_filter("manage_edit-phototype_columns", 'taxonomy_columns'); function taxonomy_columns($theme_columns) { $new_columns = array('cb' => '<input type="checkbox" />', 'name' => __('Title'), 'triangle_tax_post_thumb' => 'Gallery tile image', 'slug' => __('Slug'), 'posts' => __('Image count')); return $new_columns; } add_filter("manage_phototype_custom_column", 'manage_taxonomy_columns', 10, 3); function manage_taxonomy_columns($content, $column_name, $term_id) { $term = get_term($term_id, 'phototype');
*/ //include the main class file require_once "Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { /* * prefix of meta keys, optional */ $prefix = 'simplehome_'; /* * 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 . 'custom_icon', array('name' => __('Custom Icon ', 'tax-meta'))); /* //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
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 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();
function add_meta_field() { if (is_admin()) { $pages = array('st_cars_pickup_features'); /* * prefix of meta keys, optional */ $prefix = 'st_'; /* * configure your meta box */ $config = array('id' => 'st_extra_infomation_cars', 'title' => __('Extra Information', ST_TEXTDOMAIN), 'pages' => $pages, '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->addText($prefix . 'icon', array('name' => __('Icon', ST_TEXTDOMAIN), 'desc' => __('Example: <br>Input "fa-desktop" for <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >Fontawesome</a>,<br>Input "im-pool" for <a href="https://icomoon.io/" target="_blank">Icomoon</a> ', 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(); } }
<?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(); }
} //add_action( 'wp_head', 'insert_fb_in_head', 5 ); /** * Removing admin menus * */ function edit_admin_menus() { if (current_user_can('client_cap')) { remove_menu_page('upload.php'); } } add_action('admin_menu', 'edit_admin_menus'); require_once get_template_directory() . "/inc/Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { /* * configure taxonomy custom fields */ $config = array('id' => 'brand_info', 'title' => 'Brand Information', 'pages' => array('brands'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); /* * Initiate your taxonomy custom fields */ $my_meta = new Tax_Meta_Class($config); $my_meta->addText($prefix . 'brand_url_link', array('name' => __('Brand Homepage URL', 'tax-meta'))); $my_meta->Finish(); } function register_custom_menu_page() { add_menu_page('Docs', 'Docs', 'add_users', 'documentation/index.php', '', admin_url('documentation/assets/images/icon.png'), 1); } add_action('admin_menu', 'register_custom_menu_page');
<?php include_once "Tax-meta-class/Tax-meta-class.php"; if (is_admin()) { /* * prefix of meta keys, optional */ $prefix = 'mbd_'; /* * configure your meta box */ $config = array('id' => 'images_meta_box', 'title' => 'Images', 'pages' => array('type'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => false); /* * Initiate your meta box */ $my_meta = new Tax_Meta_Class($config); /* * Add fields to your meta box */ //Image fields $my_meta->addImage($prefix . 'thumb_image_field_id', array('name' => __('Grid Thumbnail Image ', 'tax-meta'))); /* * Don't Forget to Close up the meta box declaration */ //Finish Meta Box Declaration $my_meta->Finish(); }
register_sidebar(array('name' => __('Bottom Sidebar', 'opengov'), 'id' => 'sidebar-bottom', 'description' => __('Widgets in this area will be shown on all posts and pages on the bottom area of sidebar.', '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' => __('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);
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 start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) { global $wp_query; $my_meta = new Tax_Meta_Class(''); $indent = $depth ? str_repeat("\t", $depth) : ''; if ($depth == 0) { if (empty($item->description)) { $class = ' single'; } else { $class = false; } } else { $class = false; } $class_names = $value = ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item)); $class_names = ' class="' . esc_attr($class_names . $class) . '"'; $output .= $indent . '<li id="menu-item-' . $item->ID . '"' . $value . $class_names . '>'; $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : ''; $attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : ''; $attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : ''; $attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : ''; //$attributes .= ' data-id="'. esc_attr( $item->object_id ) .'"'; //$attributes .= ' data-slug="'. esc_attr( basename(get_permalink($item->object_id )) ) .'"'; $item_output = $args->before; $item_output .= '<a' . $attributes . '>'; if ($depth == 0) { if (isset($item->classes[4]) && in_array("ot-dropdown", $item->classes)) { $item_output .= '<span>'; } } $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; if ($depth == 0 && $item->description) { $item_output .= '<i>' . $item->description . '</i>'; } if ($depth == 0) { if (isset($item->classes[4]) && in_array("ot-dropdown", $item->classes)) { $item_output .= '</span>'; } } $item_output .= '</a>'; $item_output .= $args->after; $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); $my_meta->Finish(); }
if (is_admin()) { /* * 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_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')),
<?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();
h1 a { background-size: auto !important; width: auto !important; background-image:url(' . $pego_logo_admin . ') !important; } </style>'; } add_action('login_head', 'pego_custom_login_logo'); /*************************************************************** 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 //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
if (isset($_POST['amenity_icon_image_url'])) { $amenity_icons[$t_id]['url'] = sanitize_text_field($_POST['amenity_icon_image_url']); } } else { if (isset($_POST['amenity_icon'])) { $amenity_icons[$t_id]['icon'] = sanitize_text_field($_POST['amenity_icon']); } } update_option("amenity_icon", $amenity_icons); } function load_scripts_styles() { global $taxonomy; if ($taxonomy == 'amenity') { wp_enqueue_style('trav_admin_style', TRAV_TEMPLATE_DIRECTORY_URI . '/css/soap-icon.css'); wp_enqueue_media(); } } } } new Trav_Amenity_Custom_Field(); // location taxonomy fields require_once get_template_directory() . '/inc/lib/tax-meta-class/Tax-meta-class.php'; if (is_admin()) { $prefix = 'lc_'; $config = array('id' => 'lc_info', 'title' => 'Location Info', 'pages' => array('location'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $my_meta = new Tax_Meta_Class($config); $my_meta->addImage($prefix . 'image', array('name' => __('Thumbnail', 'trav'))); //$my_meta->addWysiwyg($prefix.'wysiwyg_field_id',array('name'=> __('My wysiwyg Editor ','trav'))); $my_meta->Finish(); }
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly // location taxonomy fields require_once get_template_directory() . '/inc/lib/tax-meta-class/Tax-meta-class.php'; if (is_admin()) { $prefix = 'ct_'; $config = array('id' => 'ct_info', 'title' => 'Custom Icon Class', 'pages' => array('tour_type', 'tour_facility', 'hotel_type', 'hotel_facility'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $my_meta = new Tax_Meta_Class($config); $my_meta->addText($prefix . 'tax_icon_class', array('name' => esc_html__('Custom Icon Class', 'citytours'), 'desc' => 'You can check <a href="http://www.soaptheme.net/wordpress/citytours/icon-pack-1/">Icon Pack1</a> and <a href="http://www.soaptheme.net/wordpress/citytours/icon-pack-2/">Icon Pack2</a> for class detail')); $my_meta->Finish(); }
Description: Tax meta class usage demo Version: 1.9.9 Author: Bainternet, Ohad Raz Author URI: http://en.bainternet.info Also: https://github.com/bainternet/Tax-Meta-Class/wiki */ //include the main class file require_once "Tax-meta-class/Tax-meta-class.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);
*/ //include the main class file require_once "tax-meta/tax-meta-class.php"; if (is_admin()) { /* * prefix of meta keys, optional */ $prefix = 'ba_'; /* * 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')));
{ echo "<pre>"; var_dump($mixed); echo "</pre>"; die; } // Enqueue all header scripts function vtms_enqueue_scripts() { wp_enqueue_style('parent', get_template_directory_uri() . '/stylesheets/styles.css', array(), get_current_version()); } add_action('wp_enqueue_scripts', 'vtms_enqueue_scripts'); /* ---------------------------------- TAXONOMY META */ $tax_meta_prefix = meta_prefix(); $config = array('id' => 'category-meta', 'title' => 'Category Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $cat_meta = new Tax_Meta_Class($config); // Category Color $cat_meta->addText($tax_meta_prefix . 'color', array('name' => __('color', 'tax-meta'))); // Category Featured Image $cat_meta->addFile($tax_meta_prefix . 'image', array('name' => __('image', 'tax-meta'))); /* ---------------------------------- (end) TAXONOMY META */ /* ---------------------------------- GET CATEGORY META */ function get_category_meta($post_id = NULL, $cat_id = NULL) { // Return array $final = array(); // All category IDs $categories = wp_get_post_categories($post_id); if (isset($categories[0]) || !is_null($cat_id)) { $has_category = true; // Get the TERM for the category