<?php
if ( ! function_exists( 'xs_pricing_tables' ) ) {

// Register Custom Taxonomy
function xs_pricing_tables() {

	$labels = array(
		'name'                       => _x( 'Table Group', 'Taxonomy General Name', 'xs' ),
		'singular_name'              => _x( 'Table Group', 'Taxonomy Singular Name', 'xs' ),
		'menu_name'                  => __( 'Table Group', 'xs' ),
		'all_items'                  => __( 'All Groups', 'xs' ),
		'parent_item'                => __( 'Parent Group', 'xs' ),
		'parent_item_colon'          => __( 'Parent Group:', 'xs' ),
		'new_item_name'              => __( 'New Pricing Table Group', 'xs' ),
		'add_new_item'               => __( 'Add New Group ', 'xs' ),
		'edit_item'                  => __( 'Edit Group Details', 'xs' ),
		'update_item'                => __( 'Update Group ', 'xs' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'xs' ),
		'search_items'               => __( 'Search Table Group', 'xs' ),
		'add_or_remove_items'        => __( 'Add or remove Group', 'xs' ),
		'choose_from_most_used'      => __( 'Choose from the most used Group', '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( 'xs_pricing_tables', array( 'xs_pricing_table' ), $args );

}

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

}


if ( ! function_exists('xs_post_type_pricing_table') ) {

// Register Custom Post Type
function xs_post_type_pricing_table() {

	$labels = array(
		'name'                => _x( 'Tables', 'Post Type General Name', 'xs' ),
		'singular_name'       => _x( 'Table', 'Post Type Singular Name', 'xs' ),
		'menu_name'           => __( 'Pricing Table', 'xs' ),
		'parent_item_colon'   => __( 'Parent Table:', 'xs' ),
		'all_items'           => __( 'All Tables', 'xs' ),
		'view_item'           => __( 'View Table', 'xs' ),
		'add_new_item'        => __( 'Add New Table', 'xs' ),
		'add_new'             => __( 'Add New Table', 'xs' ),
		'edit_item'           => __( 'Change Table', 'xs' ),
		'update_item'         => __( 'Update Table', 'xs' ),
		'search_items'        => __( 'Search Table', 'xs' ),
		'not_found'           => __( 'Not found', 'xs' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'xs' ),
	);
	$args = array(
		'label'               => __( 'xs_pricing_table', 'xs' ),
		'description'         => __( 'onEvent Pricing Table', 'xs' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'page-attributes', ),
		'taxonomies'          => array( 'xs_pricing_tables' ),
		'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,
		'exclude_from_search' => true,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'xs_pricing_table', $args );

}

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

}