Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CPT Locaties

if ( ! function_exists('location') ) {

// Register Custom Post Type
function location() {

	$labels = array(
		'name'                => _x( 'Locaties', 'Post Type General Name', 'nl_NL' ),
		'singular_name'       => _x( 'Locatie', 'Post Type Singular Name', 'nl_NL' ),
		'menu_name'           => __( 'Locaties', 'nl_NL' ),
		'name_admin_bar'      => __( 'Locaties', 'nl_NL' ),
		'parent_item_colon'   => __( 'Parent Locatie:', 'nl_NL' ),
		'all_items'           => __( 'Alle Locaties', 'nl_NL' ),
		'add_new_item'        => __( 'Nieuwe Locatie toevoegen', 'nl_NL' ),
		'add_new'             => __( 'Nieuwe Locatie toevoegen', 'nl_NL' ),
		'new_item'            => __( 'Nieuwe Locatie', 'nl_NL' ),
		'edit_item'           => __( 'Edit Locatie', 'nl_NL' ),
		'update_item'         => __( 'Update Locatie', 'nl_NL' ),
		'view_item'           => __( 'Bekijk Locatie', 'nl_NL' ),
		'search_items'        => __( 'Zoek Locatie', 'nl_NL' ),
		'not_found'           => __( 'Niet gevonden', 'nl_NL' ),
		'not_found_in_trash'  => __( 'Niet gevonden in prullenbak', 'nl_NL' ),
	);
	$rewrite = array(
		'slug'                => 'locatie',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'location', 'nl_NL' ),
		'description'         => __( 'Locaties', 'nl_NL' ),
		'labels'              => $labels,
		'supports'            => array( ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-building',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => true,
		'can_export'          => true,
		'has_archive'         => false,		
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capability_type'     => 'post',
	);
	register_post_type( 'location', $args );

}

// Hook into the 'init' action
add_action( 'init', 'location', 0 );

}