示例#1
1
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
    $allSidebarss = pego_get_all_sidebars1();
    $my_meta->addSelect($prefix . 'category_sidebar', $allSidebarss, array('name' => __('Category sidebar ', 'tax-meta')));
    //Finish Meta Box Decleration
示例#2
0
 //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
 $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);
<?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();
}
示例#4
0
require_once get_template_directory() . '/framework/libs/tax-meta-class/Tax-meta-class.php';
if (is_admin()) {
    /*
     * prefix of meta keys, optional
     */
    $prefix = 'thim_';
    /*
     * configure your meta box
     */
    $config = array('id' => 'category_meta_box', 'title' => 'Category Meta Box', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $my_meta = new Tax_Meta_Class($config);
    /*
     * Add fields to your meta box
     */
    $my_meta->addSelect($prefix . 'layout', array('' => 'Using in Theme Option', 'full-content' => 'No Sidebar', 'sidebar-left' => 'Left Sidebar', 'sidebar-right' => 'Right Sidebar'), array('name' => __('Custom Layout ', 'mabu'), 'std' => array('')));
    $my_meta->addSelect($prefix . 'custom_heading', array('' => 'Using in Theme Option', 'custom' => 'Custom'), array('name' => __('Custom Heading ', 'mabu'), 'std' => array('')));
    $my_meta->addImage($prefix . 'archive_top_image', array('name' => __('Background images Heading', 'mabu')));
    $my_meta->addColor($prefix . 'archive_cate_heading_bg_color', array('name' => __('Background Color Heading', 'mabu')));
    $my_meta->addColor($prefix . 'archive_cate_heading_text_color', array('name' => __('Text Color Heading', 'mabu')));
    $my_meta->addCheckbox($prefix . 'archive_cate_hide_title', array('name' => __('Hide Title', 'mabu')));
    $my_meta->Finish();
    /**
     * Custom Woocommerce Category Meta
     */
    $thim_wc_config = array('id' => 'woocommerce_meta_box', 'title' => 'Product Meta Box', 'pages' => array('product_cat'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
    $thim_wc_meta = new Tax_Meta_Class($thim_wc_config);
    $thim_wc_meta->addCheckbox($prefix . 'category_show_related_products', array('name' => __('Hide Related ', 'mabu'), 'desc' => __('Hide related products in single product', 'mabu')));
    $thim_wc_meta->addSelect($prefix . 'category_custom_columns', array('default' => 'Default', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => '10'), array('name' => __('Custom columns', 'mabu'), 'std' => array('default')));
    $thim_wc_meta->addtext($prefix . 'category_products_per_page', array('name' => __('Number of Products per Page', 'mabu'), 'std' => ''));
    $thim_wc_meta->Finish();
}
 //text field
 $my_meta->addText($prefix . 'text_field_id', array('name' => 'My Text '));
 //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);
示例#6
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();
}
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();
}
    /* 
     * 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()
{
    add_meta_box('postexcerpt', 'Subtitulo', 'post_excerpt_meta_box', 'proposta', 'normal', 'core');
}