Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

MAF | cpt_locations

// Register Custom Post Type
function cpt_locations() {

	$labels = array(
		'name'                  => _x( 'Standorte', 'Post Type General Name', 'madamefrigo' ),
		'singular_name'         => _x( 'Standort', 'Post Type Singular Name', 'madamefrigo' ),
		'menu_name'             => __( 'Standorte', 'madamefrigo' ),
		'name_admin_bar'        => __( 'Standorte', 'madamefrigo' ),
		'archives'              => __( 'Standorte Archiv', 'madamefrigo' ),
		'attributes'            => __( 'Standorte Attribute', 'madamefrigo' ),
		'parent_item_colon'     => __( 'Eltern Standort:', 'madamefrigo' ),
		'all_items'             => __( 'Alle Standorte', 'madamefrigo' ),
		'add_new_item'          => __( 'Neuen Standort hinzufügen', 'madamefrigo' ),
		'add_new'               => __( 'Neuen Standort hinzufügen', 'madamefrigo' ),
		'new_item'              => __( 'Neuen Standort', 'madamefrigo' ),
		'edit_item'             => __( 'Standort bearbeiten', 'madamefrigo' ),
		'update_item'           => __( 'Standort ändern', 'madamefrigo' ),
		'view_item'             => __( 'Standort ansehen', 'madamefrigo' ),
		'view_items'            => __( 'Standorte ansehen', 'madamefrigo' ),
		'search_items'          => __( 'Standort suchen', 'madamefrigo' ),
		'not_found'             => __( 'Nicht gefunden', 'madamefrigo' ),
		'not_found_in_trash'    => __( 'Nicht gefunden im Papierkorb', 'madamefrigo' ),
		'featured_image'        => __( 'Featured Image', 'madamefrigo' ),
		'set_featured_image'    => __( 'Set featured image', 'madamefrigo' ),
		'remove_featured_image' => __( 'Remove featured image', 'madamefrigo' ),
		'use_featured_image'    => __( 'Use as featured image', 'madamefrigo' ),
		'insert_into_item'      => __( 'In Standort einfügen', 'madamefrigo' ),
		'uploaded_to_this_item' => __( 'Zu diesem Standort hochgeladen', 'madamefrigo' ),
		'items_list'            => __( 'Standort Liste', 'madamefrigo' ),
		'items_list_navigation' => __( 'Standort Listen Navigation', 'madamefrigo' ),
		'filter_items_list'     => __( 'Standort Liste filtern', 'madamefrigo' ),
	);
	$args = array(
		'label'                 => __( 'Standort', 'madamefrigo' ),
		'description'           => __( 'Standorte', 'madamefrigo' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'revisions' ),
		'taxonomies'            => array( 'ct_towns' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-admin-post',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => false,
		'exclude_from_search'   => true,
		'publicly_queryable'    => false,
		'rewrite'               => false,
		'capability_type'       => 'page',
	);
	register_post_type( 'cpt_locations', $args );

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