<?php

/* Menus */
register_nav_menu( 'main', 'Hauptmenü' );

/* Custom Post Types */
function evrst_custom_init(){
  $labels = array(
    'name' => 'Albums',
    'singular_name' => 'Album',
    'add_new' => 'Add New',
    'add_new_item' => 'Add New Album',
    'edit_item' => 'Edit Album',
    'new_item' => 'New Album',
    'all_items' => 'All Albums',
    'view_item' => 'View Album',
    'search_items' => 'Search Albums',
    'not_found' =>  'No albums found',
    'not_found_in_trash' => 'No albums found in Trash',
    'parent_item_colon' => '',
    'menu_name' => 'Albums'
  );

  $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'query_var' => true,
    'rewrite' => array('slug' => 'album'),
    'capability_type' => 'post',
    'has_archive' => true,
    'hierarchical' => false,
    'menu_position' => null,
    'supports' => array('title', 'editor'),
	'taxonomies' => array('post_tag'),

  );

  register_post_type('album', $args);

  register_taxonomy(
		'genre',
		'album',
		array(
			'label' => __( 'Genre' ),
			'rewrite' => array( 'slug' => 'genre' ),
			'hierarchical' => true,
		)
	);

	  register_taxonomy(
		'label',
		'album',
		array(
			'label' => __( 'Label' ),
			'rewrite' => array( 'slug' => 'label' ),
			'hierarchical' => true,
		)
	);

}
add_action('init', 'evrst_custom_init');

function evrst_tag_name($tag)
{
    return $tag->name;
}
