cpt_resources
// Register Custom Post Type
function cpt_resources() {
$labels = array(
'name' => 'Resources',
'singular_name' => 'Resource',
'menu_name' => 'Resource Types',
'name_admin_bar' => 'Resource Type',
'archives' => 'Resource Archives',
'attributes' => 'Resource Attributes',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Resources',
'add_new_item' => 'Add New Resource',
'add_new' => 'Add New',
'new_item' => 'New Item',
'edit_item' => 'Edit Item',
'update_item' => 'Update Item',
'view_item' => 'View Item',
'view_items' => 'View Resources',
'search_items' => 'Search Item',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
'featured_image' => '',
'set_featured_image' => '',
'remove_featured_image' => '',
'use_featured_image' => '',
'insert_into_item' => 'Insert into item',
'uploaded_to_this_item' => 'Uploaded to this item',
'items_list' => 'Items list',
'items_list_navigation' => 'Items list navigation',
'filter_items_list' => 'Filter resource list',
);
$rewrite = array(
'slug' => 'resources',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => 'Resource',
'description' => 'A collection of downloadable resources that are related to products.',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'custom-fields' ),
'taxonomies' => array( 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-download',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
'show_in_rest' => true,
);
register_post_type( 'cpt_resources_type', $args );
}
add_action( 'init', 'cpt_resources', 0 );