<?php 

/*******************************************************************
Register Post Type
********************************************************************/


function cleeny_portfolio_post_type() 
{
	$labels = array(
		'name'               => _x( 'Portfolio', 'post type general name', 'cleeny' ),
		'singular_name'      => _x( 'Portfolio', 'post type singular name', 'cleeny' ),
		'menu_name'          => _x( 'Portfolio', 'admin menu', 'cleeny' ),
		'name_admin_bar'     => _x( 'Portfolio', 'add new on admin bar', 'cleeny' ),
		'add_new'            => _x( 'Add New', 'Portfolio', 'cleeny' ),
		'add_new_item'       => __( 'Add New Portfolio', 'cleeny' ),
		'new_item'           => __( 'New Portfolio', 'cleeny' ),
		'edit_item'          => __( 'Edit Portfolio', 'cleeny' ),
		'view_item'          => __( 'View Portfolio', 'cleeny' ),
		'all_items'          => __( 'All Portfolio', 'cleeny' ),
		'search_items'       => __( 'Search Portfolio', 'cleeny' ),
		'parent_item_colon'  => __( 'Parent Portfolio:', 'cleeny' ),
		'not_found'          => __( 'No Portfolio found.', 'cleeny' ),
		'not_found_in_trash' => __( 'No Portfolio found in Trash.', 'cleeny' )
	);
	
	$args = array(
		'labels'             => $labels,
		'public'             => true,
		'menu_icon'          =>'dashicons-images-alt2',		
		'exclude_from_search'=> true,
		'show_ui'            => true,
		'show_in_menu'       => true,
		'query_var'          => true,
		'rewrite'            => array( 'slug' => 'em_portfolios' ),
		'capability_type'    => 'post',
		'has_archive'        => true,
		'hierarchical'       => false,
		'menu_position'      => null,
		'supports'           => array('title','editor', 'thumbnail')
	);
	
	register_post_type( 'em_portfolio' , $args );
	
	$labels = array(
		'name'              => _x( 'Categories', 'taxonomy general name', 'cleeny' ),
		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'cleeny' ),
		'search_items'      => __( 'Search Categories', 'cleeny' ),
		'all_items'         => __( 'All Categories', 'cleeny' ),
		'parent_item'       => __( 'Parent Category', 'cleeny' ),
		'parent_item_colon' => __( 'Parent Category:', 'cleeny' ),
		'edit_item'         => __( 'Edit Category', 'cleeny' ),
		'update_item'       => __( 'Update Category', 'cleeny' ),
		'add_new_item'      => __( 'Add New Category', 'cleeny' ),
		'new_item_name'     => __( 'New Category Name', 'cleeny' ),
		'menu_name'         => __( 'Categories', 'cleeny' ),
	);

	$args = array(
		'public'            => false,
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'show_in_nav_menus' => false,
		'query_var'         => false,
		'rewrite'           => array( 'slug' => 'portfolio-category' ),
	);
	
	register_taxonomy( 'em_portfolio_cat', array( 'em_portfolio' ), $args );
}
add_action('init', 'cleeny_portfolio_post_type');


// Case Study
function cleeny_case_study_post_type() 
{
	$labels = array(
		'name'               => _x( 'Case Study', 'post type general name', 'cleeny' ),
		'singular_name'      => _x( 'Case Study', 'post type singular name', 'cleeny' ),
		'menu_name'          => _x( 'Case Study', 'admin menu', 'cleeny' ),
		'name_admin_bar'     => _x( 'Case Study', 'add new on admin bar', 'cleeny' ),
		'add_new'            => _x( 'Add New', 'Case Study', 'cleeny' ),
		'add_new_item'       => __( 'Add New Case Study', 'cleeny' ),
		'new_item'           => __( 'New Case Study', 'cleeny' ),
		'edit_item'          => __( 'Edit Case Study', 'cleeny' ),
		'view_item'          => __( 'View Case Study', 'cleeny' ),
		'all_items'          => __( 'All Case Study', 'cleeny' ),
		'search_items'       => __( 'Search Case Study', 'cleeny' ),
		'parent_item_colon'  => __( 'Parent Case Study:', 'cleeny' ),
		'not_found'          => __( 'No Case Study found.', 'cleeny' ),
		'not_found_in_trash' => __( 'No Case Study found in Trash.', 'cleeny' )
	);
	
	$args = array(
		'labels'             => $labels,
		'public'             => true,
		'menu_icon'          =>'dashicons-format-status',		
		'exclude_from_search'=> true,
		'show_ui'            => true,
		'show_in_menu'       => true,
		'query_var'          => true,
		'rewrite'            => array( 'slug' => 'em_case_study' ),
		'capability_type'    => 'post',
		'has_archive'        => true,
		'hierarchical'       => false,
		'menu_position'      => null,
		'supports'           => array('title','editor', 'thumbnail')
	);
	
	register_post_type( 'em_case_study' , $args );
	
	$labels = array(
		'name'              => _x( 'Categories', 'taxonomy general name', 'cleeny' ),
		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'cleeny' ),
		'search_items'      => __( 'Search Categories', 'cleeny' ),
		'all_items'         => __( 'All Categories', 'cleeny' ),
		'parent_item'       => __( 'Parent Category', 'cleeny' ),
		'parent_item_colon' => __( 'Parent Category:', 'cleeny' ),
		'edit_item'         => __( 'Edit Category', 'cleeny' ),
		'update_item'       => __( 'Update Category', 'cleeny' ),
		'add_new_item'      => __( 'Add New Category', 'cleeny' ),
		'new_item_name'     => __( 'New Category Name', 'cleeny' ),
		'menu_name'         => __( 'Categories', 'cleeny' ),
	);

	$args = array(
		'public'            => false,
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'show_in_nav_menus' => false,
		'query_var'         => false,
		'rewrite'           => array( 'slug' => 'casestudy-category' ),
	);
	
	register_taxonomy( 'em_case_study_cat', array( 'em_case_study' ), $args );
}
add_action('init', 'cleeny_case_study_post_type');

