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 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();
    }
}
Пример #3
0
 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();
     }
 }
Пример #4
0
/*
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);
add_action('wp_head', function () {
Пример #5
0
    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
        if (isset($categories[0])) {
            $term = get_term_by('id', $categories[0], "category");
Пример #6
0
*/
//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);
$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
*/
 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();
     }
 }
  * 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
 $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')));
Пример #9
0
<?php

//Add thumbnail support
add_theme_support('post-thumbnails');
require_once "tax-meta-class/Tax-meta-class.php";
require_once 'custom-options.php';
$config = array('id' => 'glyph', 'title' => 'Glyphicons', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
$my_meta = new Tax_Meta_Class($config);
//text field
$my_meta->addText('glyphicon', array('name' => 'Glyphicon'));
//textarea field
$my_meta->Finish();
//Enable bootstrap with jquery
function wpbootstrap_scripts_with_jquery()
{
    wp_register_script('custom-script', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'));
    wp_enqueue_script('custom-script');
}
add_action('wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery');
//Code to display comments. Called in comments.php using the &callback= function.
function display_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    if (wp_is_mobile()) {
        echo "<div class=\"well well-sm\">";
    } else {
        echo "<blockquote>";
    }
    ?>
    <?php 
    printf(__('%s'), get_comment_author_link());
Пример #10
0
<?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();
}
Пример #11
0
    /* 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
    $my_meta->Finish();
}
/***************************************************************  
Menu customization
***************************************************************/
class pego_description_walker extends Walker_Nav_Menu
{
    function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
    {
        global $wp_query;
        $indent = $depth ? str_repeat("\t", $depth) : '';
<?php

/***
* custom fields for taxonomies
* using tax-meta-class plugin
**/
/**
Field(s) for Cities
**/
if (is_admin()) {
    $prefix = 'nt_';
    /* 
     * configure meta box
     */
    $config = array('id' => 'location_info', 'title' => 'Location Information', 'pages' => array('city'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => false);
    $metabox = new Tax_Meta_Class($config);
    $metabox->addSelect($prefix . 'state-prov', array('' => 'Choose', 'AL' => 'Alabama', 'AK' => 'Alaska', 'AZ' => 'Arizona', 'AR' => 'Arkansas', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District Of Columbia', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'IA' => 'Iowa', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'ME' => 'Maine', 'MD' => 'Maryland', 'MA' => 'Massachusetts', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NE' => 'Nebraska', 'NV' => 'Nevada', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NY' => 'New York', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VT' => 'Vermont', 'VA' => 'Virginia', 'WA' => 'Washington', 'WV' => 'West Virginia', 'WI' => 'Wisconsin', 'WY' => 'Wyoming', 'AS' => 'American Samoa', 'GU' => 'Guam', 'MP' => 'Northern Mariana Islands', 'PR' => 'Puerto Rico', 'UM' => 'United States Minor Outlying Islands', 'VI' => 'Virgin Islands', 'AB' => 'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', 'NB' => 'New Brunswick', 'NL' => 'Newfoundland and Labrador', 'NS' => 'Nova Scotia', 'ON' => 'Ontario', 'PE' => 'Prince Edward Island', 'QC' => 'Quebec', 'SK' => 'Saskatchewan', 'NT' => 'Northwest Territories', 'NU' => 'Nunavut', 'YT' => 'Yukon'), array('name' => __('State/Province ', 'tax-meta'), 'std' => array('')));
    $metabox->addText($prefix . 'map_info', array('name' => __('Google Maps ', 'tax-meta'), 'desc' => 'Mapping info'));
    $metabox->addFile($prefix . 'city_img', array('name' => __('City Image ', 'tax-meta'), 'desc' => 'The image for the city'));
    $metabox->addCheckbox($prefix . 'feat_city', array('name' => __('Featured City ', 'tax-meta'), 'desc' => 'Featured city (y/n) (Shows up on home page)'));
    $metabox->Finish();
}
Пример #13
0
  * 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 '));
 //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
<?php

require_once "Tax-meta-class/Tax-meta-class.php";
if (is_admin()) {
    $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('pwinty_print_variations'), '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
     */
    //text field
    $my_meta->addText('print_variation_price', array('name' => 'Variation Price', 'desc' => 'Print Variation Price'));
    //Finish Meta Box Decleration
    $my_meta->Finish();
}
Пример #15
0
     * prefix of meta keys, optional
     */
    $prefix = 's3bubble_';
    /*
     * configure your meta box
     */
    $config = array('id' => 's3bubble_course_meta_box', 'title' => 'S3Bubble Course Meta', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    /*
     * Initiate your meta box
     */
    $my_meta = new Tax_Meta_Class($config);
    /*
     * Add fields to your meta box
     */
    //text field
    $my_meta->addText($prefix . 'extra_cat_meta_text', array('name' => __('Course Title', 'tax-meta'), 'desc' => 'this is a field desription'));
    //select field
    $my_meta->addSelect($prefix . 'extra_cat_meta_level', array('Beginner' => 'Beginner', 'Intermediate' => 'Intermediate', 'Advanced' => 'Advanced'), array('name' => 'Level', 'std' => array('selectkey3')));
    //Image field
    $my_meta->addImage($prefix . 'extra_cat_meta_image', array('name' => __('Course Image', 'tax-meta')));
    /*
     * Don't Forget to Close up the meta box decleration
     */
    //Finish Meta Box Decleration
    $my_meta->Finish();
}
//get term meta field
function get_tax_meta_s3bubble($term_id, $key, $multi = false)
{
    $t_id = is_object($term_id) ? $term_id->term_id : $term_id;
    $m = get_option('tax_meta_' . $t_id);
Пример #16
0
License: GPLv2
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) {
Пример #17
0
 function add_meta_field()
 {
     if (is_admin()) {
         $attr_list = $this->get_attributes();
         $pages = array();
         if (!empty($attr_list)) {
             foreach ($attr_list as $key => $value) {
                 $pages[] = $key;
             }
         }
         /*
          * prefix of meta keys, optional
          */
         $prefix = 'st_';
         /*
          * configure your meta box
          */
         $config = array('id' => 'st_extra_infomation', '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
          */
         //select field
         $my_meta->addText($prefix . 'icon', array('name' => __('Icon', ST_TEXTDOMAIN), 'desc' => __('You can upload your font-icon file in the site by navigating to Traveler Settings -> Importer Fonticon', 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();
     }
 }
Пример #18
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();
}
}
//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');
Пример #20
0
 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();
     }
 }
Пример #21
0
<?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();
Пример #22
0
 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();
 }
Пример #23
0
  * 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')));
 //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
     */
    $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');
}
add_action('admin_menu', 'lead_meta_box');
// Renomeia FEATURED IMAGE para ICONE