Sermons CPT
// Register Custom Post Type
function tbs_create_sermone_cpt() {
$labels = array(
'name' => _x( 'Sermons', 'Post Type General Name', 'sermons_db_' ),
'singular_name' => _x( 'Sermon', 'Post Type Singular Name', 'sermons_db_' ),
'menu_name' => __( 'Sermons', 'sermons_db_' ),
'name_admin_bar' => __( 'Sermons', 'sermons_db_' ),
'archives' => __( 'Item Archives', 'sermons_db_' ),
'attributes' => __( 'Item Attributes', 'sermons_db_' ),
'parent_item_colon' => __( 'Parent Item:', 'sermons_db_' ),
'all_items' => __( 'All Sermons', 'sermons_db_' ),
'add_new_item' => __( 'Add New Sermon', 'sermons_db_' ),
'add_new' => __( 'Add New', 'sermons_db_' ),
'new_item' => __( 'New Sermon', 'sermons_db_' ),
'edit_item' => __( 'Edit Sermon', 'sermons_db_' ),
'update_item' => __( 'Update Sermon', 'sermons_db_' ),
'view_item' => __( 'View Sermon', 'sermons_db_' ),
'view_items' => __( 'View Sermons', 'sermons_db_' ),
'search_items' => __( 'Search Sermon', 'sermons_db_' ),
'not_found' => __( 'Not found', 'sermons_db_' ),
'not_found_in_trash' => __( 'Not found in Trash', 'sermons_db_' ),
'featured_image' => __( 'Featured Image', 'sermons_db_' ),
'set_featured_image' => __( 'Set featured image', 'sermons_db_' ),
'remove_featured_image' => __( 'Remove featured image', 'sermons_db_' ),
'use_featured_image' => __( 'Use as featured image', 'sermons_db_' ),
'insert_into_item' => __( 'Insert into item', 'sermons_db_' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'sermons_db_' ),
'items_list' => __( 'Sermons list', 'sermons_db_' ),
'items_list_navigation' => __( 'Sermons list navigation', 'sermons_db_' ),
'filter_items_list' => __( 'Filter Sermons list', 'sermons_db_' ),
);
$rewrite = array(
'slug' => 'sermon',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Sermon', 'sermons_db_' ),
'description' => __( 'Post Type Description', 'sermons_db_' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'revisions' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-video-alt3',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => 'sermons',
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'tbs_sermons', $args );
}
add_action( 'init', 'tbs_create_sermone_cpt', 0 );