Season
// Register Custom Post Type
function ced_season_type() {
$labels = array(
'name' => _x( 'Seasons', 'Post Type General Name', 'cedop' ),
'singular_name' => _x( 'Season', 'Post Type Singular Name', 'cedop' ),
'menu_name' => __( 'Season', 'cedop' ),
'name_admin_bar' => __( 'Season', 'cedop' ),
'parent_item_colon' => __( 'Parent Season:', 'cedop' ),
'all_items' => __( 'All Seasons', 'cedop' ),
'add_new_item' => __( 'Add New Season', 'cedop' ),
'add_new' => __( 'Add New', 'cedop' ),
'new_item' => __( 'New Season', 'cedop' ),
'edit_item' => __( 'Edit Season', 'cedop' ),
'update_item' => __( 'Update Season', 'cedop' ),
'view_item' => __( 'View Season', 'cedop' ),
'search_items' => __( 'Search Season', 'cedop' ),
'not_found' => __( 'Not found', 'cedop' ),
'not_found_in_trash' => __( 'Not found in Trash', 'cedop' ),
);
$rewrite = array(
'slug' => 'series/%connected_series%/season',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'season', 'cedop' ),
'description' => __( 'A group of anime episodes/ part of a series', 'cedop' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'season',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'season', $args );
}
// Hook into the 'init' action
add_action( 'init', 'ced_season_type', 0 );