Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CPT Teams

// Register Custom Post Type
function sl_teams_post_type() {

	$labels = array(
		'name'                  => _x( 'Teams', 'Post Type General Name', 'sl-tabellen-import' ),
		'singular_name'         => _x( 'Team', 'Post Type Singular Name', 'sl-tabellen-import' ),
		'menu_name'             => __( 'Teams', 'sl-tabellen-import' ),
		'name_admin_bar'        => __( 'Teams', 'sl-tabellen-import' ),
		'archives'              => __( 'Team Archive', 'sl-tabellen-import' ),
		'parent_item_colon'     => __( 'Übergeordnetes Team:', 'sl-tabellen-import' ),
		'all_items'             => __( 'Alle Teams', 'sl-tabellen-import' ),
		'add_new_item'          => __( 'Neues Team hinzufügen', 'sl-tabellen-import' ),
		'add_new'               => __( 'Neues hinzufügen', 'sl-tabellen-import' ),
		'new_item'              => __( 'Neues Team', 'sl-tabellen-import' ),
		'edit_item'             => __( 'Team bearbeiten', 'sl-tabellen-import' ),
		'update_item'           => __( 'Team updaten', 'sl-tabellen-import' ),
		'view_item'             => __( 'Team ansehen', 'sl-tabellen-import' ),
		'search_items'          => __( 'Team suchen', 'sl-tabellen-import' ),
		'not_found'             => __( 'Nicht gefunden', 'sl-tabellen-import' ),
		'not_found_in_trash'    => __( 'Nicht in Papierkorb gefunden', 'sl-tabellen-import' ),
		'featured_image'        => __( 'Team Bild', 'sl-tabellen-import' ),
		'set_featured_image'    => __( 'Team Bild hochladen', 'sl-tabellen-import' ),
		'remove_featured_image' => __( 'Team Bild entfernen', 'sl-tabellen-import' ),
		'use_featured_image'    => __( 'Als Team Bild verwenden', 'sl-tabellen-import' ),
		'insert_into_item'      => __( 'Zu Teams hinzufügen', 'sl-tabellen-import' ),
		'uploaded_to_this_item' => __( 'Zu diesem Team hochgeladen', 'sl-tabellen-import' ),
		'items_list'            => __( 'Teamliste', 'sl-tabellen-import' ),
		'items_list_navigation' => __( 'Teamlisten Navigation', 'sl-tabellen-import' ),
		'filter_items_list'     => __( 'Teamliste filtern', 'sl-tabellen-import' ),
	);
	$args = array(
		'label'                 => __( 'Team', 'sl-tabellen-import' ),
		'description'           => __( 'Verwalten Sie Teams und deren Spieler', 'sl-tabellen-import' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'author', 'revisions', ),
		'taxonomies'            => array( 'sl_position' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 80,
		'menu_icon'             => 'dashicons-groups',
		'show_in_admin_bar'     => false,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => false,		
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'sl_teams', $args );

}
add_action( 'init', 'sl_teams_post_type', 0 );