Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Gydytojai_cpt

// Register Custom Post Type
function gydytojai_cpt() {

	$labels = array(
		'name'                  => 'Gydytojai',
		'singular_name'         => 'Gydytojas',
		'menu_name'             => 'Gydytojai',
		'name_admin_bar'        => 'Gydytojas',
		'archives'              => 'Gydytojų archyvas',
		'attributes'            => 'Gydytojo atributai',
		'parent_item_colon'     => 'Tėvinis',
		'all_items'             => 'Visi gydytojai',
		'add_new_item'          => 'Pridėti gydytoją',
		'add_new'               => 'Pridėti naują',
		'new_item'              => 'Naujas gydytojas',
		'edit_item'             => 'Redaguoti gydytoją',
		'update_item'           => 'Atnaujinti gydytoją',
		'view_item'             => 'Peržiūrėti gydytoją',
		'view_items'            => 'Peržiūrėti gydytojus',
		'search_items'          => 'Ieškoti gydytojo',
		'not_found'             => 'Nieko nerasta.',
		'not_found_in_trash'    => 'Nieko nerasta.',
		'featured_image'        => 'Gydytojo nuotrauka',
		'set_featured_image'    => 'Nustatyti gydytojo nuotrauka',
		'remove_featured_image' => 'Pašalinti gydytojo nuotrauką',
		'use_featured_image'    => 'Naudoti kaip gydytojo nuotrauką',
		'insert_into_item'      => 'Įterpti',
		'uploaded_to_this_item' => 'Įkelta',
		'items_list'            => 'Gydytojų sąrašas',
		'items_list_navigation' => 'Items list navigation',
		'filter_items_list'     => 'Filter items list',
	);
	$args = array(
		'label'                 => 'Gydytojas',
		'description'           => 'Gydytojų įrašų tipas.',
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes' ),
		'taxonomies'            => array( 'profesija' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'daschicons-groups',
		'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',
		'show_in_rest'          => true,
		'rest_controller_class' => 'WP_REST_Gydytojai_Controller',
	);
	register_post_type( 'gydytojai', $args );

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