CCB – News
if ( ! function_exists('register_post_type_news') ) {
// Register Custom Post Type
function register_post_type_news() {
$labels = array(
'name' => _x( 'News Items', 'Post Type General Name', 'ccb' ),
'singular_name' => _x( 'News Item', 'Post Type Singular Name', 'ccb' ),
'menu_name' => __( 'News', 'ccb' ),
'name_admin_bar' => __( 'News', 'ccb' ),
'archives' => __( 'News Archives', 'ccb' ),
'attributes' => __( 'News Attributes', 'ccb' ),
'parent_item_colon' => __( 'Parent News Item:', 'ccb' ),
'all_items' => __( 'All News Items', 'ccb' ),
'add_new_item' => __( 'Add New News Item', 'ccb' ),
'add_new' => __( 'Add New', 'ccb' ),
'new_item' => __( 'New News Item', 'ccb' ),
'edit_item' => __( 'Edit News Item', 'ccb' ),
'update_item' => __( 'Update News Item', 'ccb' ),
'view_item' => __( 'View News Item', 'ccb' ),
'view_items' => __( 'View News Items', 'ccb' ),
'search_items' => __( 'Search News Item', 'ccb' ),
'not_found' => __( 'Not found', 'ccb' ),
'not_found_in_trash' => __( 'Not found in Trash', 'ccb' ),
'featured_image' => __( 'Featured Image', 'ccb' ),
'set_featured_image' => __( 'Set featured image', 'ccb' ),
'remove_featured_image' => __( 'Remove featured image', 'ccb' ),
'use_featured_image' => __( 'Use as featured image', 'ccb' ),
'insert_into_item' => __( 'Insert into News item', 'ccb' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'ccb' ),
'items_list' => __( 'Items list', 'ccb' ),
'items_list_navigation' => __( 'Items list navigation', 'ccb' ),
'filter_items_list' => __( 'Filter items list', 'ccb' ),
);
$args = array(
'label' => __( 'News Item', 'ccb' ),
'description' => __( 'News Posts', 'ccb' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-post',
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
);
register_post_type( 'news', $args );
}
add_action( 'init', 'register_post_type_news', 0 );
}