Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Media SRCHC

// Register Custom Post Type
function media() {

	$labels = array(
		'name'                  => _x( 'Media Files', 'Post Type General Name', 'srchc' ),
		'singular_name'         => _x( 'Media', 'Post Type Singular Name', 'srchc' ),
		'menu_name'             => __( 'Media Files', 'srchc' ),
		'name_admin_bar'        => __( 'Media Files', 'srchc' ),
		'archives'              => __( 'Media Archives', 'srchc' ),
		'attributes'            => __( 'Media Attributes', 'srchc' ),
		'parent_item_colon'     => __( 'Parent Media:', 'srchc' ),
		'all_items'             => __( 'All Media', 'srchc' ),
		'add_new_item'          => __( 'Add New Media', 'srchc' ),
		'add_new'               => __( 'Add New', 'srchc' ),
		'new_item'              => __( 'New Media', 'srchc' ),
		'edit_item'             => __( 'Edit Media', 'srchc' ),
		'update_item'           => __( 'Update Media', 'srchc' ),
		'view_item'             => __( 'View Media', 'srchc' ),
		'view_items'            => __( 'View Media Files', 'srchc' ),
		'search_items'          => __( 'Search Media', 'srchc' ),
		'not_found'             => __( 'Media Not found', 'srchc' ),
		'not_found_in_trash'    => __( 'Media Not found in Trash', 'srchc' ),
		'featured_image'        => __( 'Featured Media Image', 'srchc' ),
		'set_featured_image'    => __( 'Set featured media image', 'srchc' ),
		'remove_featured_image' => __( 'Remove media featured image', 'srchc' ),
		'use_featured_image'    => __( 'Use as media featured image', 'srchc' ),
		'insert_into_item'      => __( 'Insert into media', 'srchc' ),
		'uploaded_to_this_item' => __( 'Uploaded to this media', 'srchc' ),
		'items_list'            => __( 'Media list', 'srchc' ),
		'items_list_navigation' => __( 'Media list navigation', 'srchc' ),
		'filter_items_list'     => __( 'Filter Media list', 'srchc' ),
	);
	$rewrite = array(
		'slug'                  => 'media',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Media', 'srchc' ),
		'description'           => __( 'SRCHC Media', 'srchc' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes' ),
		'taxonomies'            => array( 'media_category' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-media-document',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => false,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
	);
	register_post_type( 'media', $args );

}
add_action( 'init', 'media', 0 );