Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Databases Custom Post Type

The Database C.P.T. is used for managing different collections of database information and pairs with the Database Types Taxonomy.

if ( ! function_exists('hms_custom_post_types') ) {

// Register Custom Post Type
function hms_custom_post_types() {

	$labels = array(
		'name'                  => _x( 'Databases', 'Post Type General Name', 'hms-custom-post-types' ),
		'singular_name'         => _x( 'Database', 'Post Type Singular Name', 'hms-custom-post-types' ),
		'menu_name'             => __( 'Databases', 'hms-custom-post-types' ),
		'name_admin_bar'        => __( 'Databases', 'hms-custom-post-types' ),
		'archives'              => __( 'Database Collection', 'hms-custom-post-types' ),
		'attributes'            => __( 'Database Attributes', 'hms-custom-post-types' ),
		'parent_item_colon'     => __( 'Parent Databases:', 'hms-custom-post-types' ),
		'all_items'             => __( 'All Databases', 'hms-custom-post-types' ),
		'add_new_item'          => __( 'Add New Database', 'hms-custom-post-types' ),
		'add_new'               => __( 'Add Database', 'hms-custom-post-types' ),
		'new_item'              => __( 'New Database', 'hms-custom-post-types' ),
		'edit_item'             => __( 'Edit Database', 'hms-custom-post-types' ),
		'update_item'           => __( 'Update Database', 'hms-custom-post-types' ),
		'view_item'             => __( 'View Database', 'hms-custom-post-types' ),
		'view_items'            => __( 'View Databases', 'hms-custom-post-types' ),
		'search_items'          => __( 'Search Databases', 'hms-custom-post-types' ),
		'not_found'             => __( 'Database Not found', 'hms-custom-post-types' ),
		'not_found_in_trash'    => __( 'No Databases found in Trash', 'hms-custom-post-types' ),
		'featured_image'        => __( 'Featured Image', 'hms-custom-post-types' ),
		'set_featured_image'    => __( 'Set featured image', 'hms-custom-post-types' ),
		'remove_featured_image' => __( 'Remove featured image', 'hms-custom-post-types' ),
		'use_featured_image'    => __( 'Use as featured image', 'hms-custom-post-types' ),
		'insert_into_item'      => __( 'Insert into Database', 'hms-custom-post-types' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'hms-custom-post-types' ),
		'items_list'            => __( 'Database list', 'hms-custom-post-types' ),
		'items_list_navigation' => __( 'Databases list navigation', 'hms-custom-post-types' ),
		'filter_items_list'     => __( 'Filter Databases list', 'hms-custom-post-types' ),
	);
	$args = array(
		'label'                 => __( 'Database', 'hms-custom-post-types' ),
		'description'           => __( 'Post Type Description', 'hms-custom-post-types' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', ),
		'taxonomies'            => array( 'database_types' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-welcome-widgets-menus',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'library_databases', $args );

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

}