Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

druckbar – CPT – druckarten

if ( ! function_exists('CPT_druckbar_druckarten') ) {

// Register Custom Post Type
function CPT_druckbar_druckarten() {

	$labels = array(
		'name'                  => _x( 'Druckarten', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Druckart', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Druckarten', 'text_domain' ),
		'name_admin_bar'        => __( 'Druckart', 'text_domain' ),
		'archives'              => __( 'Druckarten-Archive', 'text_domain' ),
		'parent_item_colon'     => __( 'Übergeordnete Druckart', 'text_domain' ),
		'all_items'             => __( 'Alle Druckarten', 'text_domain' ),
		'add_new_item'          => __( 'Neues Druckart hinzufügen', 'text_domain' ),
		'add_new'               => __( 'Hinzufügen', 'text_domain' ),
		'new_item'              => __( 'Neues Druckart', 'text_domain' ),
		'edit_item'             => __( 'Druckart bearbeiten', 'text_domain' ),
		'update_item'           => __( 'Druckart aktualisieren', 'text_domain' ),
		'view_item'             => __( 'Druckart ansehen', 'text_domain' ),
		'search_items'          => __( 'Druckarten durchsuchen', 'text_domain' ),
		'not_found'             => __( 'NIcht gefunden', 'text_domain' ),
		'not_found_in_trash'    => __( 'Nicht im Mülleimer gefunden', 'text_domain' ),
		'featured_image'        => __( 'Betragsbild', 'text_domain' ),
		'set_featured_image'    => __( 'Beitragsbild festlegen', 'text_domain' ),
		'remove_featured_image' => __( 'Beitragsbild entfernen', 'text_domain' ),
		'use_featured_image'    => __( 'Als Beitragsbild nutzen', 'text_domain' ),
		'insert_into_item'      => __( 'Zum Beitrag hinzufügen', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Zu diesem Beitrag hinzugefügt', 'text_domain' ),
		'items_list'            => __( 'Liste der Druckarten', 'text_domain' ),
		'items_list_navigation' => __( 'Druckartenliste Navigation', 'text_domain' ),
		'filter_items_list'     => __( 'Druckartenliste filtern', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Druckart', 'text_domain' ),
		'description'           => __( 'Das Druckangebot der druckbar', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'page-attributes', ),
		'taxonomies'            => array( 'druckkategorie' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-image-filter',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => false,		
		'exclude_from_search'   => true,
		'publicly_queryable'    => false,
		'capability_type'       => 'post',
	);
	register_post_type( 'druckarten', $args );

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

}