WordPress Custom Post Type

function post_type_project() {
 
// Set UI labels for Custom Post Type
    $labels = array(
        'name'                => _x( 'Projects', 'Post Type General Name', 'zerman' ),
        'singular_name'       => _x( 'Project', 'Post Type Singular Name', 'zerman' ),
        'menu_name'           => __( 'Projects', 'zerman' ),
        'parent_item_colon'   => __( 'Parent Project', 'zerman' ),
        'all_items'           => __( 'All Projects', 'zerman' ),
        'view_item'           => __( 'View Project', 'zerman' ),
        'add_new_item'        => __( 'Add New Project', 'zerman' ),
        'add_new'             => __( 'Add New', 'zerman' ),
        'edit_item'           => __( 'Edit Project', 'zerman' ),
        'update_item'         => __( 'Update Project', 'zerman' ),
        'search_items'        => __( 'Search Project', 'zerman' ),
        'not_found'           => __( 'Not Found', 'zerman' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'zerman' ),
    );
     
// Set other options for Custom Post Type
     
    $args = array(
        'label'               => __( 'projects', 'zerman' ),
        'description'         => __( 'Projects in Code-Forever', 'zerman' ),
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
        'taxonomies'          => array( 'genres' ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
        'show_in_rest' => true,
 
    );
     

    register_post_type( 'projects', $args );
 
}

 
add_action( 'init', 'post_type_project', 0 );