Пример #1
0
function write_abouts()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $about_posts = new Super_Custom_Post_Type('about');
    # Test Icon. Should be a square grid.
    $about_posts->set_icon('quote-right');
    # Add a meta box with every field type
    $about_posts->add_meta_box(array('id' => 'about-fields', 'context' => 'normal', 'fields' => array('applications' => array('type' => 'wysiwyg', 'default' => ''), 'our-mission' => array('type' => 'wysiwyg', 'default' => ''), 'president-message' => array('type' => 'wysiwyg', 'default' => ''), 'goals-for-the-year' => array('type' => 'wysiwyg', 'default' => ''), 'constitution' => array('type' => 'wysiwyg', 'default' => ''))));
}
Пример #2
0
function write_organizations()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $organization_posts = new Super_Custom_Post_Type('organization');
    # Test Icon. Should be a square grid.
    $organization_posts->set_icon('users');
    # Taxonomy test, should be like tags
    //    $tax_tags = new Super_Custom_Taxonomy( 'Organization Type' );
    # Taxonomy test, should be like categories
    $tax_cats = new Super_Custom_Taxonomy('organization-type', 'Organization Type', 'Organization Types', 'cat');
    # Connect both of the above taxonomies with the post type
    connect_types_and_taxes($organization_posts, array($tax_cats));
    # Add a meta box with every field type
    $organization_posts->add_meta_box(array('id' => 'organization-fields', 'context' => 'normal', 'fields' => array('contact-phone-number' => array('default' => ''), 'email' => array('default' => ''), 'facebook' => array('default' => ''), 'twitter' => array('default' => ''), 'website' => array('default' => ''), 'hide' => array('type' => 'boolean', 'default' => ''))));
}
Пример #3
0
function write_abouts()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $about_posts = new Super_Custom_Post_Type('about');
    # Test Icon. Should be a square grid.
    $about_posts->set_icon('quote-right');
    # Taxonomy test, should be like tags
    $tax_tags = new Super_Custom_Taxonomy('tax-tag');
    # Taxonomy test, should be like categories
    $tax_cats = new Super_Custom_Taxonomy('tax-cat', 'Tax Cat', 'Tax Cats', 'category');
    # Connect both of the above taxonomies with the post type
    connect_types_and_taxes($about_posts, array($tax_tags, $tax_cats));
    # Add a meta box with every field type
    $about_posts->add_meta_box(array('id' => 'about-fields', 'context' => 'normal', 'fields' => array('our-mission' => array('type' => 'wysiwyg', 'default' => ''), 'president-message' => array('type' => 'wysiwyg', 'default' => ''), 'goals-for-the-year' => array('type' => 'wysiwyg', 'default' => ''), 'constitution' => array('type' => 'wysiwyg', 'default' => ''))));
}
Пример #4
0
function write_exec()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $exec_posts = new Super_Custom_Post_Type('exec');
    # Test Icon. Should be a square grid.
    $exec_posts->set_icon('beer');
    # Taxonomy test, should be like tags
    $tax_tags = new Super_Custom_Taxonomy('tax-tag');
    # Taxonomy test, should be like categories
    $tax_cats = new Super_Custom_Taxonomy('tax-cat', 'Tax Cat', 'Tax Cats', 'category');
    # Connect both of the above taxonomies with the post type
    connect_types_and_taxes($exec_posts, array($tax_tags, $tax_cats));
    # Add a meta box with every field type
    $exec_posts->add_meta_box(array('id' => 'event-fields', 'context' => 'normal', 'fields' => array('position' => array('type' => 'textarea', 'default' => ''), 'major' => array('type' => 'textarea', 'default' => ''), 'year' => array('default' => ''), 'facebook' => array('default' => ''), 'twitter' => array('default' => ''), 'linkedin' => array('default' => ''), 'email' => array('default' => ''))));
}
Пример #5
0
function write_events()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $event_posts = new Super_Custom_Post_Type('event');
    # Test Icon. Should be a square grid.
    $event_posts->set_icon('calendar');
    # Taxonomy test, should be like tags
    $tax_tags = new Super_Custom_Taxonomy('tax-tag');
    # Taxonomy test, should be like categories
    $tax_cats = new Super_Custom_Taxonomy('tax-cat', 'Tax Cat', 'Tax Cats', 'category');
    # Connect both of the above taxonomies with the post type
    connect_types_and_taxes($event_posts, array($tax_tags, $tax_cats));
    # Add a meta box with every field type
    $event_posts->add_meta_box(array('id' => 'event-fields', 'context' => 'normal', 'fields' => array('featured' => array('type' => 'boolean', 'default' => ''), 'facebook-link' => array('default' => ''), 'event-venue-name' => array('default' => ''), 'event-address' => array('type' => 'textarea', 'default' => ''), 'start-date' => array('type' => 'date', 'default' => ''), 'start-time' => array('default' => ''), 'end-date' => array('type' => 'date', 'default' => ''), 'end-time' => array('default' => ''), 'contact-name' => array('default' => ''), 'contact-phone-number' => array('default' => ''), 'contact-email' => array('default' => ''), 'active_event' => array('type' => 'boolean', 'default' => ''), 'participating-organizations' => array('type' => 'checkbox', 'options' => array("ASA (Asian Students Association)", "CCC (Chinese Conversation Club)", "Carolina China Network", "Chinese House", "CUSA (Chinese Undergraduate Student Association)", "FACSS (Friendship Association of Chinese Students and Scholars)", "HSAC (Hmong Student Association of Carolina)", "Japan Club", "KASA (Korean American Students Association)", "Kasama", "KASS (Korean Association of Students and Scholars)", "LiNK (Liberty in North Korea)", "Pak-Sa (Pakistani Student Association)", "RadAsians", "Sangam", "SEAIA (Southeast Asia Interest Association)", "Thai Student Association", "Taiwanese Student Association", "VSA (Vietnamese Students Association)", "Bhangra Elite", "Carolina Kendo Club", "Carolina Monkey Kung Fu", "Carolina Tai-Chi", "Chalkaa", "Ek Taal", "Flying Silk Chinese Dance Troupe", "Kamikazi Dance Crew", "Moonlight Dance Crew", "Okinawan Karate-do Goju Ryu Club", "Tar Heel Raas", "Samaa", "aKDPhi", "DPO", "KPL", "LPhiE", "PAPhi"), 'default' => ''))));
}
Пример #6
0
function write_programs()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $program_posts = new Super_Custom_Post_Type('program');
    # Test Icon. Should be a square grid.
    $program_posts->set_icon('star');
    # Taxonomy test, should be like tags
    $tax_tags = new Super_Custom_Taxonomy('tax-tag');
    # Taxonomy test, should be like categories
    $tax_cats = new Super_Custom_Taxonomy('program-type', 'Program Type', 'Program Types', 'category');
    # Connect both of the above taxonomies with the post type
    connect_types_and_taxes($program_posts, array($tax_tags, $tax_cats));
    # Add a meta box with every field type
    $program_posts->add_meta_box(array('id' => 'program-fields', 'context' => 'normal', 'fields' => array('date' => array('type' => 'date', 'default' => ''), 'time' => array('default' => ''), 'facebook-link' => array('default' => ''), 'title' => array('type' => 'textarea', 'default' => ''), 'subtitle' => array('type' => 'textarea', 'default' => ''), 'program-location' => array('type' => 'textarea', 'default' => ''), 'program-location-url' => array('default' => ''), 'coordinator-name' => array('default' => ''), 'coordinator-phone-number' => array('default' => ''), 'coordinator-email' => array('default' => ''), 'coordinator-message' => array('type' => 'wysiwyg', 'default' => ''), 'program-description' => array('type' => 'wysiwyg', 'default' => ''), 'active' => array('type' => 'radio', 'options' => array('Active', 'Past'), 'default' => ''), 'all' => array('type' => 'boolean', 'default' => ''))));
}
Пример #7
0
function jtw_work()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    $jtw_work = new Super_Custom_Post_Type('jtw_work', 'Project', 'Work', array('capability_type' => 'page', 'rewrite' => array('slug' => 'jtw_work'), 'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'page-attributes')));
    $jtw_work->set_icon('desktop');
    /*$jtw_work->add_meta_box( array(
          'id' => 'doctor-information-wrapper',
          'title' => "Basic Doctor Information",
          'fields' => array(
              'doctor-location' => array( 'type' => 'select', 'multiple' => 'multiple', 'data' => 'cmh_locations', 'class'=> 'large-text' ),
              'doctor-video-link' => array( 'type' => 'text' ),
          )
      ) );*/
    $jtw_skill = new Super_Custom_Taxonomy('jtw_skills', 'Skill', 'Skills', 'categories');
    connect_types_and_taxes($jtw_work, array($jtw_skill));
}
Пример #8
0
function scpt_ff()
{
    if (!class_exists('Super_Custom_Post_Type')) {
        return;
    }
    // Setup custom post type
    $ff_custompost = new Super_Custom_Post_Type('atom', 'Atom', 'Atomer', array('supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'post-formats')));
    $ff_custompost->set_icon('info');
}
Пример #9
0
function zp_custom_post_type()
{
    if (!class_exists('Super_CPT')) {
        return;
    }
    /*----------------------------------------------------*/
    // Add Slide Custom Post Type
    /*---------------------------------------------------*/
    $slide_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'excerpt'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/slide.png');
    // register slide post type
    $slide = new Super_Custom_Post_Type('slide', 'Slide', 'Slides', $slide_custom_default);
    $slideshow = new Super_Custom_Taxonomy('slideshow', 'Slideshow', 'Slideshows', 'cat');
    connect_types_and_taxes($slide, array($slideshow));
    $slide->add_meta_box(array('id' => 'slide-order', 'context' => 'side', 'fields' => array('slide_number_value' => array('type' => 'text', 'data-zp_desc' => __('Define slide order. Ex. 1,2,3,4,...', 'start')))));
    // manage slide columns
    function zp_add_slide_columns($columns)
    {
        return array('cb' => '<input type="checkbox" />', 'title' => __('Title', 'start'), 'slideshow' => __('Slideshow', 'start'), 'slide_order' => __('Slide Order', 'start'), 'date' => __('Date', 'start'));
    }
    add_filter('manage_slide_posts_columns', 'zp_add_slide_columns');
    function zp_custom_slide_columns($column, $post_id)
    {
        switch ($column) {
            case 'slideshow':
                $terms = get_the_term_list($post_id, 'slideshow', '', ',', '');
                if (is_string($terms)) {
                    echo $terms;
                } else {
                    _e('Unable to get slideshows(s)', 'start');
                }
                break;
            case 'slide_order':
                echo get_post_meta($post_id, 'slide_number_value', true);
                break;
        }
    }
    add_action('manage_posts_custom_column', 'zp_custom_slide_columns', 10, 2);
    /*----------------------------------------------------*/
    // Add Portfolio Custom Post Type
    /*---------------------------------------------------*/
    $portfolio_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions', 'genesis-layouts', 'genesis-seo'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register portfolio post type
    $portfolio = new Super_Custom_Post_Type('portfolio', 'Portfolio', 'Portfolio', $portfolio_custom_default);
    $portfolio_category = new Super_Custom_Taxonomy('portfolio_category', 'Portfolio Category', 'Portfolio Categories', 'cat');
    connect_types_and_taxes($portfolio, array($portfolio_category));
    $portfolio->add_meta_box(array('id' => 'portfolio-settings', 'context' => 'normal', 'priotity' => 'high', 'fields' => array('video_link' => array('label' => __('Video Link', 'start'), 'type' => 'text', 'data-zp_desc' => __('Add video link here. Video link format: Youtube: "http://www.youtube.com/watch?v=7HKoqNJtMTQ", Vimeo: "http://vimeo.com/123123"', 'start')), 'button_label' => array('label' => __('Button Label', 'start'), 'type' => 'text', 'data-zp_desc' => __('Add button label', 'start')), 'button_link' => array('label' => __('Button Link', 'start'), 'type' => 'text', 'data-zp_desc' => __('Add button link', 'start')), 'date_label' => array('label' => __('Date Label', 'start'), 'type' => 'text', 'data-zp_desc' => __('Date Label', 'start')), 'date_value' => array('label' => __('Date Value', 'start'), 'type' => 'text', 'data-zp_desc' => __('Date Value.', 'start')), 'client_label' => array('label' => __('Client Label', 'start'), 'type' => 'text', 'data-zp_desc' => __('Client Label.', 'start')), 'client_value' => array('label' => __('Client Value', 'start'), 'type' => 'text', 'data-zp_desc' => __('Client Value.', 'start')), 'category_label' => array('label' => __('Category Label', 'start'), 'type' => 'text', 'data-zp_desc' => __('Category Label.', 'start')))));
    // manage portfolio columns
    function zp_add_portfolio_columns($columns)
    {
        return array('cb' => '<input type="checkbox" />', 'title' => __('Title', 'start'), 'portfolio_category' => __('Portfolio Category', 'start'), 'author' => __('Author', 'start'), 'date' => __('Date', 'start'));
    }
    add_filter('manage_portfolio_posts_columns', 'zp_add_portfolio_columns');
    function zp_custom_portfolio_columns($column, $post_id)
    {
        switch ($column) {
            case 'portfolio_category':
                $terms = get_the_term_list($post_id, 'portfolio_category', '', ',', '');
                if (is_string($terms)) {
                    echo $terms;
                } else {
                    _e('Unable to get portfolio category(s)', 'start');
                }
                break;
        }
    }
    add_action('manage_posts_custom_column', 'zp_custom_portfolio_columns', 10, 2);
    /*----------------------------------------------------*/
    // Add Sections Custom Post Type
    /*---------------------------------------------------*/
    $sections_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register portfolio post type
    $sections = new Super_Custom_Post_Type('section', 'Section', 'Sections', $sections_custom_default);
    // add option box
    $sections->add_meta_box(array('id' => 'section-option', 'context' => 'normal', 'priotity' => 'high', 'fields' => array('include_header_label' => array('label' => __('Include Title and Intro?', 'start'), 'type' => 'select', 'options' => array('yes' => 'Yes', 'no' => 'No'), 'data-zp_desc' => __('Select Yes to include title and intro in the section', 'start')), 'navigation_anchor' => array('type' => 'text', 'data-zp_desc' => __('e.g. portfolio, blog. Then in custom menu add #portfolio, #blog...', 'start')), 'section_intro' => array('type' => 'textarea', 'data-zp_desc' => __('Enter some section intro', 'start')), 'section_background_image' => array('type' => 'media', 'data-zp_desc' => __('Section background image.', 'start')), 'section_background_color' => array('type' => 'text', 'data-zp_desc' => __('Section background color.', 'start')), 'section_text_color' => array('type' => 'text', 'data-zp_desc' => __('Section text color.', 'start')))));
    /*----------------------------------------------------*/
    // Add Testimonial Custom Post Type
    /*----------------------------------------------------*/
    $testimonial_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions', 'excerpt'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register portfolio post type
    $testimonials = new Super_Custom_Post_Type('testimonial', 'Testimonial', 'Testimonials', $testimonial_custom_default);
    // testimonial Meta boxes
    $testimonials->add_meta_box(array('id' => 'testimonial_option', 'context' => 'side', 'fields' => array('position_title' => array('type' => 'text'), 'link' => array('type' => 'text'))));
    /*----------------------------------------------------*/
    // Add Team Custom Post Type
    /*----------------------------------------------------*/
    $team_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register Team post type
    $team = new Super_Custom_Post_Type('team', 'Team', 'Teams', $team_custom_default);
    // register team metabox
    $team->add_meta_box(array('id' => 'team_settings', 'context' => 'normal', 'fields' => array('team_position' => array('type' => 'text', 'data-zp_desc' => __('Position', 'start')), 'team_link' => array('type' => 'text', 'data-zp_desc' => __('Link', 'start')), 'team_target' => array('label' => __('Link Target', 'start'), 'type' => 'select', 'options' => array('_blank' => '_blank', '_self' => '_self', '_parent' => '_parent'), 'data-zp_desc' => __('Target', 'start')))));
    $team->add_meta_box(array('id' => 'social_links', 'context' => 'normal', 'fields' => array('dribbble' => array('type' => 'text', 'data-zp_desc' => __('Dribbble link', 'start')), 'flickr' => array('type' => 'text', 'data-zp_desc' => __('Flickr link', 'start')), 'github' => array('type' => 'text', 'data-zp_desc' => __('Github link', 'start')), 'twitter' => array('type' => 'text', 'data-zp_desc' => __('Twitter link', 'start')), 'facebook' => array('type' => 'text', 'data-zp_desc' => __('Facebook link', 'start')), 'google+' => array('type' => 'text', 'data-zp_desc' => __('Google+ link', 'start')), 'skype' => array('type' => 'text', 'data-zp_desc' => __('Skype link', 'start')), 'tumblr' => array('type' => 'text', 'data-zp_desc' => __('Tumblr link', 'start')), 'vimeo' => array('type' => 'text', 'data-zp_desc' => __('Vimeo link', 'start')), 'youtube' => array('type' => 'text', 'data-zp_desc' => __('Youtube link', 'start')), 'linkedin' => array('type' => 'text', 'data-zp_desc' => __('Linkedin link', 'start')), 'pinterest' => array('type' => 'text', 'data-zp_desc' => __('Pinterest link', 'start')))));
    /*----------------------------------------------------*/
    // Add Service Custom Post Type
    /*----------------------------------------------------*/
    $services_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register services post type
    $services = new Super_Custom_Post_Type('services', 'Service', 'Services', $services_custom_default);
    // services metabox
    $services->add_meta_box(array('id' => 'services_settings', 'context' => 'normal', 'fields' => array('icon_type' => array('type' => 'select', 'options' => array('font-awesome' => 'Font-Awesome', 'glyphicons' => 'Glyphicons', 'image' => 'Image'), 'data-zp_desc' => __('Select icons to use. Font-Awesome, Glyphicons or an Image.', 'start')), 'icon_class' => array('type' => 'text', 'data-zp_desc' => __('Add icon classes. For font-awesome classes, please refer to this link <a href="http://fontawesome.io/icons/">page</a>. For Glyphicons, refer to this <a href="http://getbootstrap.com/components/">page</a> ', 'start')), 'icon_link' => array('type' => 'text', 'data-zp_desc' => __('Service item link', 'start')), 'icon_target' => array('type' => 'select', 'options' => array('_blank' => '_blank', '_self' => '_self', '_parent' => '_parent'), 'data-zp_desc' => __('Target', 'start')))));
    /*----------------------------------------------------*/
    // Pricing Table
    /*----------------------------------------------------*/
    $pricing_custom_default = array('supports' => array('title', 'editor', 'thumbnail', 'revisions'), 'menu_icon' => get_stylesheet_directory_uri() . '/include/cpt/images/portfolio.png');
    // register pricing post type
    $pricing = new Super_Custom_Post_Type('pricing', 'Pricing', 'Pricing', $pricing_custom_default);
    // pricing metabox
    $pricing->add_meta_box(array('id' => 'pricing_settings', 'context' => 'normal', 'fields' => array('price' => array('type' => 'text', 'data-zp_desc' => __('Add price. Include currency symbol ( $, €, £)', 'start')), 'payment_terms' => array('type' => 'text', 'data-zp_desc' => __('Payment Terms. (per month, per year, annually,...etc.)', 'start')), 'best_price' => array('type' => 'select', 'options' => array('bestprice' => 'Best Price', 'normal' => 'Normal'), 'data-zp_desc' => __('Select if this is the best price to highlight', 'start')), 'button_label' => array('type' => 'text', 'data-zp_desc' => __('Button label (Sign Up, Join Now, Buy,... )', 'start')), 'button_link' => array('type' => 'text', 'data-zp_desc' => __('Button link', 'start')))));
}