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

// Register Custom Taxonomy
function xs_sliders() {

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

}

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

}


if ( ! function_exists('xs_post_type_slider') ) {

// Register Custom Post Type
function xs_post_type_slider() {

	$labels = array(
		'name'                => _x( 'Images', 'Post Type General Name', 'xs' ),
		'singular_name'       => _x( 'Image', 'Post Type Singular Name', 'xs' ),
		'menu_name'           => __( 'onEvent Slider', 'xs' ),
		'parent_item_colon'   => __( 'Parent Image:', 'xs' ),
		'all_items'           => __( 'All Images', 'xs' ),
		'view_item'           => __( 'View Image', 'xs' ),
		'add_new_item'        => __( 'Add New Image', 'xs' ),
		'add_new'             => __( 'Add New Image', 'xs' ),
		'edit_item'           => __( 'Change Image', 'xs' ),
		'update_item'         => __( 'Update Image', 'xs' ),
		'search_items'        => __( 'Search Image', 'xs' ),
		'not_found'           => __( 'Not found', 'xs' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'xs' ),
	);
	$args = array(
		'label'               => __( 'xs_slider', 'xs' ),
		'description'         => __( 'onEvent Bootstrap Slider', 'xs' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'excerpt', 'page-attributes', ),
		'taxonomies'          => array( 'xs_sliders' ),
		'hierarchical'        => true,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'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_slider', $args );

}

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

}