Past Gig Post
Adding a CPT for adding audio etc to past gigs
if ( ! function_exists('past_gig_post') ) {
// Register Custom Post Type
function past_gig_post() {
$labels = array(
'name' => _x( 'Past Gigs', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Past Gig', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Past Gigs', 'text_domain' ),
'parent_item_colon' => __( 'Parent Gig:', 'text_domain' ),
'all_items' => __( 'All Gigs', 'text_domain' ),
'view_item' => __( 'View Gig', 'text_domain' ),
'add_new_item' => __( 'Add New Gig', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'edit_item' => __( 'Edit Gig', 'text_domain' ),
'update_item' => __( 'Update Gig', 'text_domain' ),
'search_items' => __( 'Search Gigs', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$rewrite = array(
'slug' => 'past-gig',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'add_a_gig', 'text_domain' ),
'description' => __( 'Adding audio etc. from past gigs', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'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' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'add_a_gig', $args );
}
// Hook into the 'init' action
add_action( 'init', 'past_gig_post', 0 );
}