<?php

if (!function_exists('xs_post_type_sponsor')) {

// Register Custom Post Type
    function xs_post_type_sponsor() {

        $labels = array(
            'name' => _x('Sponsors', 'Post Type General Name', 'xs'),
            'singular_name' => _x('Sponsor', 'Post Type Singular Name', 'xs'),
            'menu_name' => __('Sponsors', 'xs'),
            'parent_item_colon' => __('Parent Sponsor:', 'xs'),
            'all_items' => __('All Sponsors', 'xs'),
            'view_item' => __('View Sponsor', 'xs'),
            'add_new_item' => __('Add New Sponsor', 'xs'),
            'add_new' => __('Add New Sponsor', 'xs'),
            'edit_item' => __('Change Sponsor', 'xs'),
            'update_item' => __('Update Sponsor', 'xs'),
            'search_items' => __('Search Sponsor', 'xs'),
            'not_found' => __('Not found', 'xs'),
            'not_found_in_trash' => __('Not found in Trash', 'xs'),
        );
        $args = array(
            'label' => __('xs_sponsor', 'xs'),
            'description' => __('onEvent Sponsor', 'xs'),
            'labels' => $labels,
            'supports' => array('title', 'page-attributes',),
            'taxonomies' => array(''),
            'hierarchical' => false,
            'public' => false,
            'show_ui' => true,
            'show_in_menu' => true,
            'show_in_nav_menus' => false,
            'show_in_admin_bar' => true,
            'menu_position' => 5,
            'can_export' => true,
            'has_archive' => true,
            'rewrite' => false,
            'exclude_from_search' => true,
            'publicly_queryable' => true,
            'capability_type' => 'page',
        );
        register_post_type('xs_sponsor', $args);
    }

// Hook into the 'init' action
    add_action('init', 'xs_post_type_sponsor', 0);
}


if (!function_exists('sponsor_cat')) {

    function sponsor_cat() {

        $labels = array(
            'name' => _x('Sponsor Category', 'Taxonomy General Name', 'xs'),
            'singular_name' => _x('Sponsor Category', 'Taxonomy Singular Name', 'xs'),
            'menu_name' => __('Sponsor Category', 'xs'),
            'all_items' => __('All Sponsor Category', 'xs'),
            'parent_item' => __('Parent Sponsor Category', 'xs'),
            'parent_item_colon' => __('Parent Sponsor Category:', 'xs'),
            'new_item_name' => __('New Sponsor Category', 'xs'),
            'add_new_item' => __('Add New Sponsor Category ', 'xs'),
            'edit_item' => __('Edit Sponsor Category Details', 'xs'),
            'update_item' => __('Update Sponsor Category ', 'xs'),
            'separate_items_with_commas' => __('Separate items with commas', 'xs'),
            'search_items' => __('Search Sponsor Category', 'xs'),
            'add_or_remove_items' => __('Add or remove Sponsor Category', 'xs'),
            'choose_from_most_used' => __('Choose from the most used Sponsor Category', 'xs'),
            'not_found' => __('Not Found', 'xs'),
        );
        $args = array(
            'labels' => $labels,
            'hierarchical' => true,
            'public' => false,
            'show_ui' => true,
            'show_admin_column' => true,
            'show_in_nav_menus' => false,
            'show_tagcloud' => false,
        );
        register_taxonomy('sponsor_cat', array('xs_sponsor'), $args);
    }

// Hook into the 'init' action
    add_action('init', 'sponsor_cat', 0);
}