File: /home/kashmira/public_html/razitahir.com/wp-content/plugins/upress-widgets/inc/cpt-mb/videos.php
<?php
// Register Custom Post Type Video
function create_video_cpt() {
	$labels = array(
		'name' => _x( 'Videos', 'Post Type General Name', 'urdupress' ),
		'singular_name' => _x( 'Video', 'Post Type Singular Name', 'urdupress' ),
		'menu_name' => _x( 'Videos', 'Admin Menu text', 'urdupress' ),
		'name_admin_bar' => _x( 'Video', 'Add New on Toolbar', 'urdupress' ),
		'archives' => __( 'Video Archives', 'urdupress' ),
		'attributes' => __( 'Video Attributes', 'urdupress' ),
		'parent_item_colon' => __( 'Parent Video:', 'urdupress' ),
		'all_items' => __( 'All Videos', 'urdupress' ),
		'add_new_item' => __( 'Add New Video', 'urdupress' ),
		'add_new' => __( 'Add New', 'urdupress' ),
		'new_item' => __( 'New Video', 'urdupress' ),
		'edit_item' => __( 'Edit Video', 'urdupress' ),
		'update_item' => __( 'Update Video', 'urdupress' ),
		'view_item' => __( 'View Video', 'urdupress' ),
		'view_items' => __( 'View Videos', 'urdupress' ),
		'search_items' => __( 'Search Video', 'urdupress' ),
		'not_found' => __( 'Not found', 'urdupress' ),
		'not_found_in_trash' => __( 'Not found in Trash', 'urdupress' ),
		'featured_image' => __( 'Featured Image', 'urdupress' ),
		'set_featured_image' => __( 'Set featured image', 'urdupress' ),
		'remove_featured_image' => __( 'Remove featured image', 'urdupress' ),
		'use_featured_image' => __( 'Use as featured image', 'urdupress' ),
		'insert_into_item' => __( 'Insert into Video', 'urdupress' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Video', 'urdupress' ),
		'items_list' => __( 'Videos list', 'urdupress' ),
		'items_list_navigation' => __( 'Videos list navigation', 'urdupress' ),
		'filter_items_list' => __( 'Filter Videos list', 'urdupress' ),
	);
	$args = array(
		'label' => __( 'Video', 'urdupress' ),
		'description' => __( '', 'urdupress' ),
		'labels' => $labels,
		'menu_icon' => 'dashicons-format-video',
		'supports' => array('title', 'excerpt', 'thumbnail', 'comments'),
		'taxonomies' => array('post_tag'),
		'public' => true,
		'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,
		'hierarchical' => false,
		'exclude_from_search' => false,
		'show_in_rest' => true,
		'publicly_queryable' => true,
		'capability_type' => 'post',
	);
	register_post_type( 'video', $args );
}
add_action( 'init', 'create_video_cpt', 0 );
function create_video_taxonomy() {
    $labels = array(
        'name'              => _x( 'Categories', 'taxonomy general name', 'urdupress' ),
        'singular_name'     => _x( 'Category', 'taxonomy singular name', 'urdupress' ),
        'search_items'      => __( 'Search Categories', 'urdupress' ),
        'all_items'         => __( 'All Categories', 'urdupress' ),
        'parent_item'       => __( 'Parent Category', 'urdupress' ),
        'parent_item_colon' => __( 'Parent Category:', 'urdupress' ),
        'edit_item'         => __( 'Edit Category', 'urdupress' ),
        'update_item'       => __( 'Update Category', 'urdupress' ),
        'add_new_item'      => __( 'Add New Category', 'urdupress' ),
        'new_item_name'     => __( 'New Category Name', 'urdupress' ),
        'menu_name'         => __( 'Categories', 'urdupress' ),
    );
    $args = array(
        'hierarchical'      => true, // Set to true if you want categories to behave like hierarchical terms (similar to post categories)
        'labels'            => $labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'video-category' ), // Replace with your desired slug for the category URLs
    );
    register_taxonomy( 'video_category', array( 'video' ), $args );
}
add_action( 'init', 'create_video_taxonomy' );