Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

cpt_koncerty

// Register Custom Post Type
function cpt_koncerty() {

	$labels = array(
		'name'                  => _x( 'koncerty', 'Post Type General Name', 'rd' ),
		'singular_name'         => _x( 'koncert', 'Post Type Singular Name', 'rd' ),
		'menu_name'             => __( 'Koncerty', 'rd' ),
		'name_admin_bar'        => __( 'Koncerty', 'rd' ),
		'archives'              => __( 'Archiwa koncertów', 'rd' ),
		'attributes'            => __( 'Atrybuty', 'rd' ),
		'parent_item_colon'     => __( 'Nadrzędny', 'rd' ),
		'all_items'             => __( 'Wszystkie', 'rd' ),
		'add_new_item'          => __( 'Dodaj nowy koncert', 'rd' ),
		'add_new'               => __( 'Dodaj nowy', 'rd' ),
		'new_item'              => __( 'Nowy koncert', 'rd' ),
		'edit_item'             => __( 'Edytuj koncert', 'rd' ),
		'update_item'           => __( 'Aktualizuj koncert', 'rd' ),
		'view_item'             => __( 'Zobacz koncert', 'rd' ),
		'view_items'            => __( 'Zobacz koncerty', 'rd' ),
		'search_items'          => __( 'Szukaj koncertów', 'rd' ),
		'not_found'             => __( 'Nie znaleziono', 'rd' ),
		'not_found_in_trash'    => __( 'Nie znaleziono w koszu', 'rd' ),
		'featured_image'        => __( 'Obrazek wyróżniający dla koncertu', 'rd' ),
		'set_featured_image'    => __( 'Ustaw obrazek wyróżniający', 'rd' ),
		'remove_featured_image' => __( 'Usuń obrazek wyróżniający', 'rd' ),
		'use_featured_image'    => __( 'Użyj jako obrazka wyróżniającego', 'rd' ),
		'insert_into_item'      => __( 'Wstaw w koncert', 'rd' ),
		'uploaded_to_this_item' => __( 'Załadowane do tego koncertu', 'rd' ),
		'items_list'            => __( 'Lista koncertów', 'rd' ),
		'items_list_navigation' => __( 'Nawigacja listy koncertów', 'rd' ),
		'filter_items_list'     => __( 'Filtruj listę koncertów', 'rd' ),
	);
	$rewrite = array(
		'slug'                  => 'post_type',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'koncert', 'rd' ),
		'description'           => __( 'terminy koncertów', 'rd' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'excerpt', 'thumbnail', ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-format-audio',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
	);
	register_post_type( 'koncerty', $args );

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