Example #1
0
<?php

$page = new Cuztom_Post_Type('page');
$page->add_meta_box('content_block', 'Content Area (Optional)', array(array('name' => 'sub_heading', 'label' => 'Sub Heading', 'description' => 'This will display under Heading.', 'type' => 'textarea'), array('name' => 'redirect_url', 'label' => 'Redirect URL', 'description' => 'This will redirect page to mentioned url.', 'type' => 'text')));
$page->add_meta_box('appointment_block', 'Appointment content (Optional: This will be displayed only with appointment forms.)', array(array('name' => 'appointment_pdf', 'label' => 'Upload appointment form PDF', 'description' => 'This is only for pdf file.', 'type' => 'file')));
Example #2
0
<?php

$map_post = new Cuztom_Post_Type('page');
$map_post->add_meta_box('meta_box_2', 'Map', array(array('label' => __('Country Name ', 'takeaway'), 'name' => 'casa_address_country_name', 'type' => 'text', 'description' => __('Country', 'takeaway')), array('label' => __('Region Name', 'takeaway'), 'name' => 'casa_address_region_name', 'type' => 'text', 'description' => __('Region', 'takeaway')), array('label' => __('Address Name', 'takeaway'), 'name' => 'casa_address_name', 'type' => 'text', 'description' => __('Address', 'takeaway')), array('label' => __('Zip Code of Region', 'takeaway'), 'name' => 'casa_address_zip', 'type' => 'text', 'description' => __('ZIP codes', 'takeaway')), array('name' => 'convert_zip', 'label' => 'Covert to zip code to latitude and longitude', 'description' => 'click checkbox to find result', 'type' => 'checkbox', 'default_value' => 'off'), array('label' => __('Latitude', 'takeaway'), 'name' => 'casa_address_lat', 'type' => 'text', 'std' => '0', 'description' => __('Latitude', 'takeaway')), array('label' => __('Longitude', 'takeaway'), 'name' => 'casa_address_lng', 'type' => 'text', 'std' => '0', 'description' => __('longitude', 'takeaway'))));
$atmf = new Cuztom_Post_Type('page');
$atmf->add_meta_box('atmf_meta_box', 'Settings for atmf search page', array(array('name' => 'show_mega_call', 'label' => 'Check to show mega call block', 'description' => 'Mega call block show/hide', 'type' => 'checkbox', 'default_value' => 'on')));
$address_meta = new Cuztom_Post_Type('page');
$address_meta->add_meta_box('meta_box_3', 'Address and Schedule', array(array('label' => __('Title ', 'takeaway'), 'name' => 'address_meta_title', 'type' => 'text', 'description' => __('Title for the address', 'takeaway')), array('label' => __('Address', 'takeaway'), 'name' => 'address_meta_address', 'type' => 'text', 'description' => __('Full address', 'takeaway')), array('label' => __('Schedule', 'takeaway'), 'name' => 'address_meta_schedule', 'type' => 'text', 'description' => __('e.g: Monday - Friday:9am - 11pm Saturday:10am - till last customer Sunday:10am - till last customer', 'casa'))));
$address_meta->add_meta_box('meta_box_4', 'Address and Schedule of second location', array(array('label' => __('Title ', 'takeaway'), 'name' => 'address_meta_title', 'type' => 'text', 'description' => __('Title for the address', 'takeaway')), array('label' => __('Address', 'takeaway'), 'name' => 'address_meta_address', 'type' => 'text', 'description' => __('Full address', 'takeaway')), array('label' => __('Schedule', 'takeaway'), 'name' => 'address_meta_schedule', 'type' => 'text', 'description' => __('e.g: Monday - Friday:9am - 11pm Saturday:10am - till last customer Sunday:10am - till last customer', 'casa'))));
Example #3
0
$testimonial = new Cuztom_Post_Type('testimonial', array("label" => 'Testimonials', 'has_archive' => true, 'supports' => array('title', 'excerpt', 'thumbnail')));
$testimonial->add_meta_box('testimonial_author_info', 'Testimonial Author Information', array(array('name' => 'testimonial_author_name', 'label' => 'Testimonial Author Name', 'description' => 'Put the author name here', 'type' => 'text')));
$chef = new Cuztom_Post_Type('chef', array('menu_position' => 9, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail', 'comments'), 'taxonomies' => array('category', 'post_tag')));
$chef->add_meta_box('chef_meta_box', 'General Information', array(array('name' => 'name', 'label' => 'Name of the Chef:', 'description' => 'Enter Name e.g: Abu Antar', 'type' => 'text'), array('name' => 'designation', 'label' => 'designation of the Chef:', 'description' => 'Enter designation e.g: Master chef', 'type' => 'text'), array('name' => 'Experience', 'label' => 'Experience:', 'description' => 'Enter experience e.g: 20 years', 'type' => 'text'), array('name' => 'School', 'label' => 'School:', 'description' => 'Enter School name e.g: Paris Cuisine University', 'type' => 'text'), array('name' => 'Speciality', 'label' => 'Speciality:', 'description' => 'Speciality e.g: Modern French Cuisine', 'type' => 'text'), array('name' => 'Favourite', 'label' => 'Favourite Cuisine:', 'description' => 'Favourite Cuisine e.g: Asian Traditional', 'type' => 'text'), array('name' => 'Cooks', 'label' => 'Cooks for us:', 'description' => 'e.g: 7 years', 'type' => 'text'), array('name' => 'Staff', 'label' => 'Staff Managed:', 'description' => 'e.g: 15 Persons', 'type' => 'text'), array('name' => 'takeaway_preview_image', 'label' => 'Preview image:', 'description' => 'Upload image 360 x 375 for best view ', 'type' => 'image')));
$news = new Cuztom_Post_Type('news', array('menu_position' => 10, 'taxonomies' => array('category', 'post_tag'), 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments')));
$news->add_meta_box('news_meta_box', 'Location', array(array('name' => 'country', 'label' => 'Name of the country:', 'type' => 'text'), array('name' => 'region', 'label' => 'Region:', 'type' => 'text'), array('name' => 'zip', 'label' => 'Zip Code:', 'type' => 'text')));
$news->add_meta_box('ingrediant_meta_box', 'Ingrediant', array(array('name' => 'checkbox', 'label' => 'Ingrediant on/off', 'description' => 'Do you want ingrediant field?', 'type' => 'checkbox', 'default_value' => 'on'), array('name' => 'ingrediant', 'label' => 'Ingrediants:', 'description' => 'name ingrediants by separating comma.', 'type' => 'text')));
$front_page_meta = new Cuztom_Post_Type('page');
$args = array('post_type' => 'block', 'posts_per_page' => -1);
$get_all_block_posts = get_posts($args);
$all_block_posts = array();
foreach ($get_all_block_posts as $key => $value) {
    $all_block_posts[$value->ID] = $value->post_title;
}
$front_page_meta->add_meta_box('front_page_meta_box', 'All Block Posts', array(array('name' => 'name_select', 'label' => 'Multiple Select', 'description' => 'select multiple post to show in the front page', 'type' => 'multi_select', 'options' => $all_block_posts, 'default_value' => 'value2')));
$product = new Cuztom_Post_Type('product');
$args = array('rewrite' => array('slug' => 'cuisines'));
$product->add_taxonomy('Cuisines', $args);
// $takeaway_grp_price = new Cuztom_Post_Type( 'product' );
// $takeaway_grp_price->add_meta_box(
//   'price_for_grouped_product',
//   'Price for the main product',
//    array(
//             array(
//                 'label' => __('Main Price ', 'takeaway'),
//                 'name' => 'grp_product_price',
//                 'type' => 'text',
//                 'description' => __('If you want variation then please do not add main price' , 'takeaway'),
//             ),
//           )
//  );
Example #4
0
<?php

//Generic Modular Content Template for Posts and Pages
function remove_meta_boxes()
{
    remove_meta_box('postcustom', 'page', 'normal');
    //Custom fields metabox
    remove_meta_box('commentstatusdiv', 'page', 'normal');
    //Comments status metabox (discussion)
    remove_meta_box('commentsdiv', 'page', 'normal');
    //Comments metabox
    remove_meta_box('trackbacksdiv', 'page', 'normal');
    //Trackbacks metabox
    remove_meta_box('authordiv', 'page', 'normal');
    //Author metabox
    remove_meta_box('slugdiv', 'page', 'normal');
    //Slug metabox
    remove_meta_box('postexcerpt', 'page', 'normal');
    //Excerpt metabox
    remove_meta_box('postimagediv', 'page', 'side');
    //Featured image metabox
}
add_action('admin_menu', 'remove_meta_boxes');
$pages = new Cuztom_Post_Type('page');
$pages->add_meta_box('banner', 'Featured banner', array(array('name' => 'image', 'label' => 'Banner Image', 'description' => 'Dimensions 1200px x 800px', 'type' => 'image'), array('name' => 'logo', 'label' => 'Logo/Icon', 'description' => '', 'type' => 'image'), array('name' => 'heading', 'label' => 'Banner Text', 'description' => 'Enter text', 'type' => 'wysiwyg'), array('name' => 'subheading', 'label' => 'Banner Subheading', 'description' => 'Enter text', 'type' => 'text')));
$pages->add_meta_box('badge', 'Hero Badge', array(array('name' => 'text', 'label' => 'Badge Text', 'description' => '', 'type' => 'wysiwyg'), array('name' => 'link', 'label' => 'Badge Link', 'description' => '', 'type' => 'text')));
$pages->add_meta_box('test', 'Testimonial', array(array('name' => 'testimonial', 'label' => 'Testimonial', 'description' => '', 'type' => 'wysiwyg'), array('name' => 'source', 'label' => 'Source', 'description' => '', 'type' => 'text'), array('name' => 'title', 'label' => 'Source Title', 'description' => '', 'type' => 'text'), array('name' => 'caption', 'label' => 'Caption', 'description' => '', 'type' => 'text')));
$pages->add_meta_box('cta', 'Bottom Call to Action Panel', array(array('name' => 'heading', 'label' => 'CTA Text', 'description' => '', 'type' => 'text'), array('name' => 'blink', 'label' => 'Button Link', 'description' => '', 'type' => 'text'), array('name' => 'btext', 'label' => 'Button Text', 'description' => '', 'type' => 'text')));
Example #5
0
<?php

//Generic Modular Content Template for Posts and Pages
function remove_meta_boxes()
{
    remove_meta_box('postcustom', 'page', 'normal');
    //Custom fields metabox
    remove_meta_box('commentstatusdiv', 'page', 'normal');
    //Comments status metabox (discussion)
    remove_meta_box('commentsdiv', 'page', 'normal');
    //Comments metabox
    remove_meta_box('trackbacksdiv', 'page', 'normal');
    //Trackbacks metabox
    remove_meta_box('authordiv', 'page', 'normal');
    //Author metabox
    remove_meta_box('slugdiv', 'page', 'normal');
    //Slug metabox
    remove_meta_box('postexcerpt', 'page', 'normal');
    //Excerpt metabox
    remove_meta_box('postimagediv', 'page', 'side');
    //Featured image metabox
}
add_action('admin_menu', 'remove_meta_boxes');
$pages = new Cuztom_Post_Type('page');
$pages->add_meta_box('banner', 'Featured banner', array(array('name' => 'image', 'label' => 'Banner Image', 'description' => 'Dimensions 1200px x 800px', 'type' => 'image'), array('name' => 'heading', 'label' => 'Banner Text', 'description' => 'Enter text', 'type' => 'wysiwyg')));
Example #6
0
add_filter("manage_edit-dish_cat_columns", 'takeaway_types_tax_columns');
function takeaway_types_tax_columns($category_columns)
{
    $new_columns = array('cb' => '<input type="checkbox" />', 'name' => __('Name', 'casa'), 'marker' => __('Marker', 'casa'), 'description' => __('Description', 'casa'), 'slug' => __('Slug', 'casa'), 'posts' => __('Items', 'casa'));
    return $new_columns;
}
/*show type taxonomy column*/
add_filter("manage_dish_cat_custom_column", 'takeaway_manage_category_columns', 10, 3);
function takeaway_manage_category_columns($out, $column_name, $cat_id)
{
    $marker = get_option('term_meta_dish_cat_' . $cat_id, '');
    // print_r($marker);
    if (!empty($marker)) {
        $marker_icon = wp_get_attachment_image_src($marker['_marker_icon'], array(32, 32));
    }
    switch ($column_name) {
        case 'marker':
            if (!empty($marker_icon[0])) {
                $out .= '<img src="' . $marker_icon[0] . '" alt="">';
            }
            break;
        default:
            break;
    }
    return $out;
}
// Add image field to Genre (Note that you need to wrap all the fields in an array).
$chef = new Cuztom_Post_Type('chef', array('menu_position' => 9, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail', 'comments'), 'taxonomies' => array('category', 'post_tag')));
$chef->add_meta_box('chef_meta_box', 'General Information', array(array('name' => 'name', 'label' => 'Name of the Chef:', 'description' => 'Enter Name e.g: Abu Antar', 'type' => 'text'), array('name' => 'designation', 'label' => 'Designation', 'description' => 'Select a Designation', 'type' => 'select', 'options' => array('Master chef' => 'Master Chef', 'Chef' => 'Chef', 'value3' => 'Other'), 'default_value' => 'Chef'), array('name' => 'Experience', 'label' => 'Experience:', 'description' => 'Enter experience e.g: 20 years', 'type' => 'text'), array('name' => 'School', 'label' => 'School:', 'description' => 'Enter School name e.g: Paris Cuisine University', 'type' => 'text'), array('name' => 'Speciality', 'label' => 'Speciality:', 'description' => 'Speciality e.g: Modern French Cuisine', 'type' => 'text'), array('name' => 'Favourite', 'label' => 'Favourite Cuisine:', 'description' => 'Favourite Cuisine e.g: Asian Traditional', 'type' => 'text'), array('name' => 'Cooks', 'label' => 'Cooks for us:', 'description' => 'e.g: 7 years', 'type' => 'text'), array('name' => 'Staff', 'label' => 'Staff Managed:', 'description' => 'e.g: 15 Persons', 'type' => 'text')));
$news = new Cuztom_Post_Type('news', array('menu_position' => 10, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail', 'comments'), 'taxonomies' => array('category', 'post_tag')));
$news->add_meta_box('ingrediant_meta_box', 'Ingrediant', array(array('name' => 'checkbox', 'label' => 'Ingrediant on/off', 'description' => 'Do you want ingrediant field?', 'type' => 'checkbox', 'default_value' => 'on'), array('name' => 'ingrediant', 'label' => 'Ingrediants:', 'description' => 'name ingrediants by separating comma.', 'type' => 'text')));
<?php

//Create product custom post type
$products = new Cuztom_Post_Type('product');
add_action('init', 'product_remove_post_type_support', 10);
function product_remove_post_type_support()
{
    remove_post_type_support('product', 'editor');
    remove_post_type_support('product', 'custom-fields');
}
$products->add_taxonomy('Body system');
$products->add_taxonomy('Indication');
$products->add_meta_box('Product Details', 'product_details', array(array('name' => 'folk_name', 'label' => 'Folk Name', 'description' => 'Please enter folk name for this herb.', 'type' => 'text'), array('name' => 'expensive_herb', 'label' => 'Expensive Herb', 'description' => 'Is this herb expensive? Pick expensive or extra expensive.', 'type' => 'select', 'options' => array('' => 'Select expensive or extra expensive', '*' => 'Expensive', '**' => 'Extra Expensive')), array('name' => 'monograph_link', 'label' => 'Monograph Link', 'description' => 'Please enter monograph link for this herb.', 'type' => 'text'), array('name' => 'warnings', 'label' => 'Warnings & Interactions', 'description' => '', 'type' => 'wysiwyg'), array('name' => 'dosage', 'label' => 'Dosage', 'description' => '', 'type' => 'wysiwyg')));
//Add or Remove column into Product Page
// add_filter('manage_edit-product_columns', 'product_list_into_product_list');
// function product_list_into_product_list($defaults) {
// unset($defaults['product_tag']);
// $defaults['_product_details_folk_name'] = 'Folk name';
// return $defaults;
// }
// Show Coloumn for Products List into Admin
add_filter('manage_product_posts_columns', 'hype_columns_head_only_products', 10);
add_action('manage_product_posts_custom_column', 'hype_columns_content_only_products', 10, 2);
// Functions for Products List into Admin
function hype_columns_head_only_products($defaults)
{
    unset($defaults['product_tag']);
    $defaults['_product_details_folk_name'] = 'Folk';
    return $defaults;
}
function hype_columns_content_only_products($column_name, $post_ID)
    //Comments status metabox (discussion)
    remove_meta_box('commentsdiv', 'page', 'normal');
    //Comments metabox
    remove_meta_box('commentsdiv', 'post', 'normal');
    //Comments metabox
    remove_meta_box('trackbacksdiv', 'post', 'normal');
    //Trackbacks metabox
    remove_meta_box('trackbacksdiv', 'page', 'normal');
    //Trackbacks metabox
    remove_meta_box('authordiv', 'post', 'normal');
    //Author metabox
    remove_meta_box('authordiv', 'page', 'normal');
    //Author metabox
    remove_meta_box('slugdiv', 'post', 'normal');
    //Slug metabox
    remove_meta_box('slugdiv', 'page', 'normal');
    //Slug metabox
    //remove_meta_box('postexcerpt', 'post', 'normal'); //Excerpt metabox
    //remove_meta_box('postexcerpt', 'page', 'normal'); //Excerpt metabox
    //remove_meta_box('postimagediv', 'post', 'normal'); //Featured image metabox
    //remove_meta_box('postimagediv', 'page', 'normal'); //Featured image metabox
}
add_action('admin_menu', 'remove_meta_boxes');
$posts = new Cuztom_Post_Type('post');
$pages = new Cuztom_Post_Type('page');
$pages->add_meta_box('banner', 'Featured banner OR video (Optional)', array(array('name' => 'heading', 'label' => 'Headline', 'description' => 'Enter Headline', 'type' => 'text'), array('name' => 'subheading', 'label' => 'Subheading', 'description' => 'Enter Subheadine', 'type' => 'text'), array('name' => 'video', 'label' => 'Banner Video', 'description' => 'Enter Video URL/Link', 'type' => 'text'), array('name' => 'image', 'label' => 'Banner Image', 'description' => 'Dimensions 1200px x 600px', 'type' => 'image')));
$pages->add_meta_box('full_width', 'Full width image (Optional)', array(array('name' => 'image', 'label' => 'Image', 'description' => 'Dimensions 1200px x 600px', 'type' => 'image'), array('name' => 'text', 'label' => 'Text Overlay', 'description' => 'Text that will overlay image', 'type' => 'textarea'), array('name' => 'order', 'label' => 'Modular Order', 'description' => 'Add a large Concise sub Heading', 'type' => 'select', 'options' => array('value1' => '1', 'value2' => '2', 'value3' => '3'), 'default_value' => 'value1')));
$pages->add_meta_box('content_block_1', 'Content Area (Optional)', array(array('name' => 'text', 'label' => 'Text', 'description' => 'Text area', 'type' => 'wysiwyg'), array('name' => 'order', 'label' => 'Modular Order', 'description' => 'Add a large Concise sub Heading', 'type' => 'select', 'options' => array('value1' => '1', 'value2' => '2', 'value3' => '3'), 'default_value' => 'value1')));
$posts->add_meta_box('banner', 'Featured banner OR video (Optional)', array(array('name' => 'heading', 'label' => 'Headline', 'description' => 'Enter Headline', 'type' => 'text'), array('name' => 'subheading', 'label' => 'Subheading', 'description' => 'Enter Subheadine', 'type' => 'text'), array('name' => 'video', 'label' => 'Banner Video', 'description' => 'Enter Video URL/Link', 'type' => 'text'), array('name' => 'image', 'label' => 'Banner Image', 'description' => 'Dimensions 1200px x 600px', 'type' => 'image'), array('name' => 'logo', 'label' => 'Logo', 'description' => 'Upload Logo', 'type' => 'file')));
$posts->add_meta_box('full_width', 'Full width image (Optional)', array(array('name' => 'image', 'label' => 'Image', 'description' => 'Dimensions 1200px x 600px', 'type' => 'image'), array('name' => 'text', 'label' => 'Text Overlay', 'description' => 'Text that will overlay image', 'type' => 'textarea'), array('name' => 'order', 'label' => 'Modular Order', 'description' => 'Add a large Concise sub Heading', 'type' => 'select', 'options' => array('value1' => '1', 'value2' => '2', 'value3' => '3'), 'default_value' => 'value1')));
$posts->add_meta_box('content_block_1', 'Content Area (Optional)', array(array('name' => 'text', 'label' => 'Text', 'description' => 'Text area', 'type' => 'wysiwyg'), array('name' => 'order', 'label' => 'Modular Order', 'description' => 'Add a large Concise sub Heading', 'type' => 'select', 'options' => array('value1' => '1', 'value2' => '2', 'value3' => '3'), 'default_value' => 'value1')));
    return $title;
}
add_filter('enter_title_here', 'change_default_title');
/*-----------------------------------------------------------------------------------*/
/*	  custom meta box of service section 
/*-----------------------------------------------------------------------------------*/
$service = register_cuztom_post_type('service', array('supports' => array('title', 'editor'), 'show_names' => false, 'menu_icon' => 'dashicons-id'));
$service->add_meta_box('service_setting_id', 'Service Section Settings', array(array('name' => 'icon', 'label' => 'Icon', 'description' => 'Write icon class - "li_star, li_lab, li_world" <a target="_blank" href="https://github.com/fontello/linecons.font">Click Here</a>', 'type' => 'text'), array('name' => 'learn_more', 'label' => 'Edit Learn More', 'description' => '', 'type' => 'text', 'default_value' => 'Learn More'), array('name' => 'animation', 'label' => 'Animation', 'description' => 'Write the class here like "from-bottom delay-200"', 'type' => 'text', 'default_value' => 'from-bottom delay-200')));
/*-----------------------------------------------------------------------------------*/
/*	  portfolio custom post type with  metabox
/*-----------------------------------------------------------------------------------*/
$gallery = register_cuztom_post_type('gallery', array('menu_icon' => 'dashicons-analytics', 'rewrite' => array('slug' => 'galleries', 'with_front' => false), 'supports' => array('title', 'thumbnail')));
$gallery->add_meta_box('gallery_setting_id', 'gallery Section Settings', array(array('name' => 'caption', 'label' => 'Caption', 'description' => 'Write Image Caption', 'type' => 'textarea')));
$gallery = register_cuztom_taxonomy('filter_menu', array('gallery'), array('hierarchical' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true));
/*-----------------------------------------------------------------------------------*/
/*	  causes custom post type with  metabox
/*-----------------------------------------------------------------------------------*/
$causes = register_cuztom_post_type('causes', array('menu_icon' => 'dashicons-migrate', 'rewrite' => array('slug' => 'causes', 'with_front' => false), 'supports' => array('title', 'thumbnail', 'editor')));
$causes->add_meta_box('causes_setting_id', 'Causes Section Settings', array(array('name' => 'donation_currency_symbol', 'label' => 'Currency Symbol', 'description' => 'Add your Currency Symbol', 'default_value' => '$', 'type' => 'text'), array('name' => 'donation_goal', 'label' => 'Donation goal', 'description' => 'How much is the donation goal for this cause.', 'type' => 'text'), array('name' => 'donation_manual', 'label' => 'Donate manually', 'description' => 'Write manual ammount, that will add with current ammount', 'type' => 'text'), array('name' => 'donation_paypal', 'label' => 'PayPal', 'description' => 'Write Your PayPal Id.', 'type' => 'text'), array('name' => 'bank_transfer_manual', 'label' => 'Direct Bank Transfer', 'description' => 'Trasfer money to the following bank account (Write the bank account info)', 'type' => 'textarea'), array('name' => 'chaque_payment', 'label' => 'Check Payment', 'description' => 'Send chaque to the following address. (Writer the address)', 'type' => 'textarea'), array('name' => 'menual_payment_link', 'label' => 'Custom URL/WooCommerce Product link', 'description' => "<b style=\"color: red;\">If PayPal Donate field blank, This custom link will work. Paste woocommerce product link</b>", 'type' => 'text')));
/*-----------------------------------------------------------------------------------*/
/*	custom post type of event with meta box 
/*-----------------------------------------------------------------------------------*/
$event = register_cuztom_post_type('event', array('menu_icon' => 'dashicons-art', 'rewrite' => array('slug' => 'events', 'with_front' => false), 'supports' => array('title', 'thumbnail', 'editor')));
$event->add_meta_box('events_setting_id', 'Events Section Settings', array(array('name' => 'event_time', 'label' => 'Event Start', 'description' => 'When event will start', 'type' => 'time'), array('name' => 'event_time_end', 'label' => 'Event End', 'description' => 'When event will end', 'type' => 'time'), array('name' => 'event_date', 'label' => 'Event Date', 'description' => 'Event starting date', 'type' => 'date'), array('name' => 'event_timezone', 'label' => 'Event Timezone', 'description' => 'Write Time zone', 'type' => 'text'), array('name' => 'event_place', 'label' => 'Event Place', 'description' => 'Where event will held', 'type' => 'textarea'), array('name' => 'event_place_map', 'label' => 'Map', 'description' => 'write longitude & latitude with coma. <a target="_blank" href="http://www.gps-coordinates.net/">Click here</a> for help.', 'type' => 'text')));
/*-----------------------------------------------------------------------------------*/
/*	post formate meta box 
/*-----------------------------------------------------------------------------------*/
$posts = new Cuztom_Post_Type('post');
$posts->add_meta_box('post-meta-quote', 'Page Head', array(array('name' => 'speaker', 'label' => 'Who said that', 'description' => 'Write the name of speaker name', 'type' => 'text')));
$posts->add_meta_box('post-meta-audio', 'Audio settings', array(array('name' => 'audio', 'label' => 'Upload Audio file', 'description' => 'It will play above the title', 'type' => 'file')));
$posts->add_meta_box('post-meta-video', 'Video settings', array(array('name' => 'video', 'label' => 'Link', 'description' => 'It will play above the title', 'type' => 'text')));
Example #10
0
 public function createCustomPostType()
 {
     $cpt = new \Cuztom_Post_Type('onepageblock', array('has_archive' => false, 'supports' => array('title', 'editor')));
     $cpt->add_meta_box('achtergrond', 'set background for this block', array(array('name' => 'position', 'label' => 'Positie', 'description' => 'gefixeert of scroll', 'type' => 'select', 'options' => array('fixed' => 'fixed', 'parrallax' => 'parrallax', 'scroll' => 'scroll')), array('name' => 'image', 'label' => 'Afbeelding', 'description' => 'Selecteer afbeelding', 'type' => 'image')));
 }
Example #11
0
<?php

//Content Template for Pages
function remove_meta_boxes()
{
    remove_meta_box('postcustom', 'page', 'normal');
    //Custom fields metabox
    remove_meta_box('commentstatusdiv', 'page', 'normal');
    //Comments status metabox (discussion)
    remove_meta_box('commentsdiv', 'page', 'normal');
    //Comments metabox
    remove_meta_box('trackbacksdiv', 'page', 'normal');
    //Trackbacks metabox
    remove_meta_box('authordiv', 'page', 'normal');
    //Author metabox
    remove_meta_box('slugdiv', 'page', 'normal');
    //Slug metabox
    //remove_meta_box('postexcerpt', 'page', 'normal'); //Excerpt metabox
    //remove_meta_box('postimagediv', 'page', 'side'); //Featured image metabox
}
add_action('admin_menu', 'remove_meta_boxes');
$pages = new Cuztom_Post_Type('page');
$pages->add_meta_box('banner', 'Headline', array(array('name' => 'text', 'label' => 'Enter Headline', 'description' => '', 'type' => 'text'), array('name' => 'subhead', 'label' => 'Enter Subhead', 'description' => '', 'type' => 'text')));
$pages->add_meta_box('action', 'Take action', array(array('name' => 'button', 'label' => 'Button label', 'description' => 'Enter button label and make your users want to click', 'type' => 'text'), array('name' => 'url', 'label' => 'Url', 'description' => 'Example: http://www.foodshare.net/', 'type' => 'text')));
$pages->add_meta_box('sticky', 'Sticky Footer', array(array('name' => 'lineone', 'label' => 'Enter Line 1', 'description' => '', 'type' => 'text'), array('name' => 'linetwo', 'label' => 'Enter Line 2', 'description' => '', 'type' => 'text'), array('name' => 'btn', 'label' => 'Button Text', 'description' => '', 'type' => 'text'), array('name' => 'url', 'label' => 'Button Url', 'description' => 'Example: http://www.foodshare.net/', 'type' => 'text')));
$pages->add_meta_box('video', 'Video <i>(Optional)</i>', array(array('name' => 'select', 'label' => 'Select a related video', 'description' => '', 'type' => 'post_select', 'args' => array('post_type' => 'video', 'show_option_none' => "Select a Video"))));
$pages->add_meta_box('slide', 'Gallery <i>(Optional)</i>', array(array('name' => 'select', 'label' => 'Select a related gallery', 'description' => '', 'type' => 'post_select', 'args' => array('post_type' => 'gallery', 'show_option_none' => "Select a Gallery"))));
$pages->add_meta_box('map', 'Map <i>(Optional)</i>', array(array('name' => 'select', 'label' => 'Select a related map', 'description' => '', 'type' => 'post_select', 'args' => array('post_type' => 'map', 'show_option_none' => "Select a Map"))));
Example #12
0
<?php

//Generic Modular Content Template for Posts and Pages
function remove_meta_boxes()
{
    remove_meta_box('postcustom', 'page', 'normal');
    //Custom fields metabox
    remove_meta_box('commentstatusdiv', 'page', 'normal');
    //Comments status metabox (discussion)
    remove_meta_box('commentsdiv', 'page', 'normal');
    //Comments metabox
    remove_meta_box('trackbacksdiv', 'page', 'normal');
    //Trackbacks metabox
    remove_meta_box('authordiv', 'page', 'normal');
    //Author metabox
    remove_meta_box('slugdiv', 'page', 'normal');
    //Slug metabox
    remove_meta_box('postexcerpt', 'page', 'normal');
    //Excerpt metabox
    remove_meta_box('postimagediv', 'page', 'side');
    //Featured image metabox
}
add_action('admin_menu', 'remove_meta_boxes');
$pages = new Cuztom_Post_Type('page');
$pages->add_meta_box('banner', 'Featured banner', array(array('name' => '', 'label' => 'Overview Intro', 'description' => 'Insert Overview intro here', 'type' => 'image'), array('name' => 'name_textarea', 'label' => 'Overview Text', 'description' => 'Insert Overview text content here.', 'type' => 'image'), array('name' => 'name_text', 'label' => 'Overview Intro', 'description' => 'Insert Overview intro here', 'type' => 'image'), array('name' => 'name_textarea', 'label' => 'Overview Text', 'description' => 'Insert Overview text content here.', 'type' => 'image'), array('name' => 'name_text', 'label' => 'Overview Intro', 'description' => 'Insert Overview intro here', 'type' => 'image'), array('name' => 'name_textarea', 'label' => 'Overview Text', 'description' => 'Insert Overview text content here.', 'type' => 'image')));
Example #13
0
<?php

/* Adds the Product post type */
$products = new Cuztom_Post_Type('Products', array('has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail')));
/* Adds metaboxes to products */
$products->add_meta_box('Product info', array(array('name' => 'product_link', 'label' => 'Product url', 'description' => 'Link to product', 'type' => 'text'), array('name' => 'product_description', 'label' => 'Product description', 'description' => 'One line description of product', 'type' => 'textarea'), array('name' => 'product_price', 'label' => 'Product price', 'description' => 'Price of the product', 'type' => 'text')));
function add_custom_taxonomies()
{
    register_taxonomy('department', 'products', array('hierarchical' => true, 'labels' => array('name' => _x('Department', 'taxonomy general name'), 'singular_name' => _x('Department', 'taxonomy singular name'), 'search_items' => __('Search Department'), 'all_items' => __('All Department'), 'parent_item' => __('Parent Department'), 'parent_item_colon' => __('Parent Department:'), 'edit_item' => __('Edit Department'), 'update_item' => __('Update Department'), 'add_new_item' => __('Add New Department'), 'new_item_name' => __('New Department Name'), 'menu_name' => __('Department')), 'rewrite' => array('slug' => 'department', 'with_front' => false, 'hierarchical' => true)));
}
add_action('init', 'add_custom_taxonomies', 0);
<?php

//Generic Modular Content Template for Posts
$posts = new Cuztom_Post_Type('post');
$posts->add_meta_box('authors', 'Authors', array(array('name' => 'authorlist', 'label' => 'Author List', 'description' => 'In case of multiple authors.', 'type' => 'wysiwyg')));
$posts->add_meta_box('blogadd', 'Blog Extras', array(array('name' => 'hero', 'label' => 'Banner Image', 'description' => 'Upload image here.', 'type' => 'image'), array('name' => 'heroheading', 'label' => 'Alternate Page Title', 'description' => 'Smaller type that appears above the large subheading.', 'type' => 'text'), array('name' => 'subheading', 'label' => 'Subheading', 'description' => 'Insert subheading here', 'type' => 'text'), array('name' => 'pullquote', 'label' => 'Intro/Top Pullquote', 'description' => 'Appears at the top of the blog post.', 'type' => 'wysiwyg')));