Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CPT_Action_Items

if ( ! function_exists('CPT_Action_Items') ) {

// Register Custom Post Type
function CPT_Action_Items() {

	$labels = array(
		'name'                => _x( 'Actiepunten', 'Post Type General Name', 'cpt_ai_text' ),
		'singular_name'       => _x( 'Actiepunt', 'Post Type Singular Name', 'cpt_ai_text' ),
		'menu_name'           => __( 'Actiepunten', 'cpt_ai_text' ),
		'parent_item_colon'   => __( 'Hoofd Actiepunt:', 'cpt_ai_text' ),
		'all_items'           => __( 'Alle Actiepunten', 'cpt_ai_text' ),
		'view_item'           => __( 'Bekijk Actiepunt', 'cpt_ai_text' ),
		'add_new_item'        => __( 'Nieuw Actiepunt toevoegen', 'cpt_ai_text' ),
		'add_new'             => __( 'Actiepunt toevoegen', 'cpt_ai_text' ),
		'edit_item'           => __( 'Bewerk Actiepunt', 'cpt_ai_text' ),
		'update_item'         => __( 'Update Actiepunt', 'cpt_ai_text' ),
		'search_items'        => __( 'Zoek Actiepunt', 'cpt_ai_text' ),
		'not_found'           => __( 'Niet gevonden', 'cpt_ai_text' ),
		'not_found_in_trash'  => __( 'Niet gevonden in prullebak', 'cpt_ai_text' ),
	);
	$rewrite = array(
		'slug'                => 'action-item',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => false,
	);
	$capabilities = array(
		'edit_post'           => 'edit_post',
		'read_post'           => 'read_post',
		'delete_post'         => 'delete_posts',
		'edit_posts'          => 'edit_posts',
		'edit_others_posts'   => 'edit_others_posts',
		'publish_posts'       => 'publish_posts',
		'read_private_posts'  => 'read_private_posts',
	);
	$args = array(
		'label'               => __( 'cpt_ai', 'cpt_ai_text' ),
		'description'         => __( 'VVE Actiepunten', 'cpt_ai_text' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 60,
		'menu_icon'           => 'http://icon.here/img.png',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'query_var'           => 'cpt_ai',
		'rewrite'             => $rewrite,
		'capabilities'        => $capabilities,
	);
	register_post_type( 'cpt_ai', $args );

}

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

}