Accreditation cpt
// Register Custom Post Type
function accreditation_post_type() {
$labels = array(
'name' => _x( 'Accreditations', 'Post Type General Name', 'inscom' ),
'singular_name' => _x( 'Accreditation', 'Post Type Singular Name', 'inscom' ),
'menu_name' => __( 'Accreditations', 'inscom' ),
'name_admin_bar' => __( 'Accreditation', 'inscom' ),
'archives' => __( 'Item Accreditations', 'inscom' ),
'attributes' => __( 'Item Attributes', 'inscom' ),
'parent_item_colon' => __( 'Parent Item:', 'inscom' ),
'all_items' => __( 'All Accreditations', 'inscom' ),
'add_new_item' => __( 'Add New Accreditation', 'inscom' ),
'add_new' => __( 'Add Accreditation', 'inscom' ),
'new_item' => __( 'New Accreditation', 'inscom' ),
'edit_item' => __( 'Edit Accreditation', 'inscom' ),
'update_item' => __( 'Update Accreditation', 'inscom' ),
'view_item' => __( 'View Accreditation', 'inscom' ),
'view_items' => __( 'View Accreditation', 'inscom' ),
'search_items' => __( 'Search Accreditation', 'inscom' ),
'not_found' => __( 'Accreditation Not found', 'inscom' ),
'not_found_in_trash' => __( 'Accreditation Not found in Trash', 'inscom' ),
'featured_image' => __( 'Featured Image', 'inscom' ),
'set_featured_image' => __( 'Set featured image', 'inscom' ),
'remove_featured_image' => __( 'Remove featured image', 'inscom' ),
'use_featured_image' => __( 'Use as featured image', 'inscom' ),
'insert_into_item' => __( 'Insert into Accreditation', 'inscom' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'inscom' ),
'items_list' => __( 'Accreditations list', 'inscom' ),
'items_list_navigation' => __( 'Accreditations list navigation', 'inscom' ),
'filter_items_list' => __( 'Filter Accreditations list', 'inscom' ),
);
$args = array(
'label' => __( 'Accreditation', 'inscom' ),
'description' => __( 'Accreditation for vendors', 'inscom' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'comments', 'custom-fields' ),
'hierarchical' => false,
'public' => false,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
'rest_base' => 'accreditations',
);
register_post_type( 'accreditation', $args );
}
add_action( 'init', 'accreditation_post_type', 0 );