コード例 #1
0
ファイル: case-type.php プロジェクト: JeppeSigaard/smamo16
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();
    }
}
コード例 #2
0
<?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();
}
コード例 #3
0
/*
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();
}
コード例 #4
0
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);
$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));
コード例 #5
0
ファイル: taxonomy-meta.php プロジェクト: BersnardC/DROPINN
                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();
}
コード例 #6
0
ファイル: tax-meta.php プロジェクト: vinhnq1211/funy
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();
}
コード例 #7
0
ファイル: cat_meta.php プロジェクト: jefferose/geodirectory
  * 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
 /*	if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){
コード例 #8
0
ファイル: cat_meta.php プロジェクト: bangjojo/wp
  * 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
 /*	if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){
コード例 #9
0
 //textarea field
 $my_meta->addTextarea($prefix . 'textarea_field_id', array('name' => 'My Textarea '));
 //checkbox field
 $my_meta->addCheckbox($prefix . 'checkbox_field_id', array('name' => 'My Checkbox '));
 //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);
コード例 #10
0
<?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();
}
コード例 #11
0
<?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();
}
コード例 #12
0
ファイル: wp_extra_cat_fields.php プロジェクト: allenahner/wp
     * 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];
    } else {
        return '';
コード例 #13
0
ファイル: bb-repost.php プロジェクト: BrownBox/bb-repost
Copyright 2015 Brown Box
*/
include 'classes/cpt_.php';
include 'classes/meta_.php';
include 'classes/tax_.php';
include 'classes/tax_meta_.php';
include 'ui.php';
include 'settings.php';
new bb_repost\cptClass('Repost', 'Reposts', array('taxonomies' => array('post_tag')));
$fields = array(array('title' => 'Source Article', 'field_name' => 'source_article'), array('title' => 'Source Excerpt', 'field_name' => 'source_excerpt', 'type' => 'textarea'), array('title' => 'Twitter', 'field_name' => 'twitter', 'type' => 'checkbox'));
new bb_repost\metaClass('Reposts', array('repost'), $fields);
new bb_repost\taxClass('Source Type', 'Source Types', array('repost'));
$config = array('id' => 'sourcetype_meta_box', 'title' => 'Source Type Meta', 'pages' => array('sourcetype'), 'local_images' => true, 'use_with_theme' => false);
$sourcetype_meta = new Tax_Meta_Class($config);
$sourcetype_meta->addText('tagline', array('name' => 'Tag Line', 'desc' => 'Text to display at the bottom of each post'));
$sourcetype_meta->addImage('avatar', array('name' => 'Post Avatar', 'desc' => 'Custom avatar for this type of post. If left blank will use author avatar.'));
$sourcetype_meta->addImage('button_image', array('name' => 'Button Image', 'desc' => 'Custom button image for this type of post. If left blank will use plain HTML button.'));
$sourcetype_meta->Finish();
add_action('wp_enqueue_scripts', 'bb_repost_frontend_scripts');
function bb_repost_frontend_scripts()
{
    wp_enqueue_style('normalize', '/wp-content/plugins/bb-repost/css/normalize.css');
}
add_action('init', 'bb_repost_add_default_source_types', 10);
function bb_repost_add_default_source_types()
{
    $inited = get_option('bb_repost_initialised');
    if (!$inited) {
        $terms = array('We did this' => '', "We're listening to this" => 'Todays artist of the day is...', 'We read this' => '', 'We wrote this' => '');
        foreach ($terms as $term => $description) {
            wp_insert_term($term, 'sourcetype', array('description' => $description));
コード例 #14
0
     */
    $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();
}
コード例 #15
0
<?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();
}
コード例 #16
0
ファイル: taxonomy.php プロジェクト: lytranuit/wordpress
 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();
 }
コード例 #17
0
// for category customization
require_once "Tax-meta-class/Tax-meta-class.php";
global $current_user;
get_currentuserinfo();
/*
* configure taxonomy custom fields
*/
$configt = array('id' => 'categ_meta_box', 'title' => 'Category options', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
/*
* Initiate your taxonomy custom fields
*/
$custom_category = new Tax_Meta_Class($configt);
/*
* Add fields
*/
//Categories image
$custom_category->addImage('categ_img', array('name' => __('Download an image for your category', 'iftheme')));
//Display children checkbox
$custom_category->addCheckbox('categ_children', array('name' => __('Display sub-categories', 'iftheme'), 'desc' => __("Check this box if you want to display a list of child categories", 'iftheme')));
//Display children checkbox
$check = true;
if (isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'category') {
    $check = isset($_GET['tag_ID']) ? get_tax_meta($_GET['tag_ID'], 'categ_posts') : true;
}
$custom_category->addCheckbox('categ_posts', array('name' => __('Display Posts', 'iftheme'), 'desc' => __("Check this box if you want to display a list of the category's posts", 'iftheme'), 'std' => $check));
//hidden field
//to avoid conflict with wpml plugin
//global $current_user; get_currentuserinfo();
//$custom_category->addHidden('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
//$custom_category->addText('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
$custom_category->Finish();
コード例 #18
0
 * 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');
        switch ($column_name) {
            case 'triangle_tax_post_thumb':
                $data = get_tax_meta($term_id, 'image_field_id', true);
                $attachID = $data['id'];
コード例 #19
0
ファイル: usage.php プロジェクト: adrianaguirre/wp-plugins
 //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
 $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);
コード例 #20
0
     */
    $prefix = 'cda_';
    /* 
     * configure your meta box
     */
    $config_cat = array('id' => 'cda_meta_box_cat', 'title' => '', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    $config_post = array('id' => 'cda_meta_box_post', 'title' => ' ', 'pages' => array('proposta'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    /*
     * Initiate your meta box
     */
    $my_meta_cat = new Tax_Meta_Class($config_cat);
    $my_meta_post = new AT_Meta_Box($config_post);
    //radio field
    $my_meta_cat->addRadio($prefix . 'radio_field_id', array('piloto' => 'Projeto Piloto', 'conceito' => 'Projeto Conceito'), array('name' => __('Tipo do Projeto', 'tax-meta'), 'std' => array('conceito')));
    //Image field
    $my_meta_cat->addImage($prefix . 'image_field_id', array('name' => __('Imagem representativa ', 'tax-meta')));
    //Color field
    $my_meta_cat->addColor($prefix . 'color_field_id', array('name' => __('Cor representativa ', 'tax-meta')));
    //List of images to build background and slideshow image
    $my_meta_cat->addText($prefix . 'text_field_id', array('name' => __('Lista de ID para imagens a serem utilizadas no mosaico e slideshow ', 'tax-meta')));
    $my_meta_cat->addText($prefix . 'text_field_id_2', array('name' => __('Lista de ID de ícones do passo 3', 'tax-meta')));
    $my_meta_cat->addImage($prefix . 'image_2_field_id', array('name' => __('Mapa para Sugestões do Passo 3', 'tax-meta')));
    //Color field
    $my_meta_post->addColor($prefix . 'color_field_id_post', array('name' => 'Cor representativa '));
    //Finish Meta Box Decleration
    $my_meta_cat->Finish();
    $my_meta_post->Finish();
}
// Renomeia EXERPT para SUBTITULO
function lead_meta_box()
{