<?php

/*-----------------------------------------------------------------------------------

	Add Photo Post Type

-----------------------------------------------------------------------------------*/


function tz_create_post_type_photos() 
{
	$labels = array(
		'name' => __( 'Photos','framework'),
		'singular_name' => __( 'Photo','framework' ),
		'add_new' => __('Add New','framework'),
		'add_new_item' => __('Add New Photo','framework'),
		'edit_item' => __('Edit Photo','framework'),
		'new_item' => __('New Photo','framework'),
		'view_item' => __('View Photo','framework'),
		'search_items' => __('Search Photo','framework'),
		'not_found' =>  __('No photos found','framework'),
		'not_found_in_trash' => __('No photos found in Trash','framework'), 
		'parent_item_colon' => ''
	  );
	  
	  $args = array(
		'labels' => $labels,
		'public' => true,
		'exclude_from_search' => true,
		'publicly_queryable' => true,
		'show_ui' => true, 
		'query_var' => true,
		'capability_type' => 'post',
		'hierarchical' => false,
		'menu_position' => null,
		'supports' => array('title','editor','thumbnail','custom-fields','excerpt','comments')
	  ); 
	  
	  register_post_type(__( 'photo' ),$args);
}




function tz_build_taxonomies(){
	register_taxonomy(__( "photo-type" ), array(__( "photo" )), array("hierarchical" => true, "label" => __( "Photo Types" ), "singular_label" => __( "Photo Type" ), "rewrite" => array('slug' => 'photo-type', 'hierarchical' => true))); 
}


function tz_photo_edit_columns($columns){  

        $columns = array(  
            "cb" => "<input type=\"checkbox\" />",  
            "title" => __( 'Photo Item Title' ),
            "type" => __( 'type' )
        );  
  
        return $columns;  
}  
  
function tz_photo_custom_columns($column){  
        global $post;  
        switch ($column)  
        {    
            case __( 'type' ):  
                echo get_the_term_list($post->ID, __( 'photo-type' ), '', ', ','');  
                break;
        }  
}  

add_action( 'init', 'tz_create_post_type_photos' );
add_action( 'init', 'tz_build_taxonomies', 0 );
add_filter("manage_edit-photo_columns", "tz_photo_edit_columns");  
add_action("manage_posts_custom_column",  "tz_photo_custom_columns");  

?>