Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

University Country

if ( ! function_exists( 'estry_edu_mr_country_tax' ) ) {

// Register Custom Taxonomy
function estry_edu_mr_country_tax() {

	$labels = array(
		'name'                       => _x( 'Countries', 'Taxonomy General Name', 'estry-edu-mar' ),
		'singular_name'              => _x( 'Country', 'Taxonomy Singular Name', 'estry-edu-mar' ),
		'menu_name'                  => __( 'Countries', 'estry-edu-mar' ),
		'all_items'                  => __( 'All Countries', 'estry-edu-mar' ),
		'parent_item'                => __( 'Parent Country', 'estry-edu-mar' ),
		'parent_item_colon'          => __( 'Parent Country:', 'estry-edu-mar' ),
		'new_item_name'              => __( 'New Country Name', 'estry-edu-mar' ),
		'add_new_item'               => __( 'Add New Country', 'estry-edu-mar' ),
		'edit_item'                  => __( 'Edit Country', 'estry-edu-mar' ),
		'update_item'                => __( 'Update Country', 'estry-edu-mar' ),
		'view_item'                  => __( 'View Country', 'estry-edu-mar' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'estry-edu-mar' ),
		'add_or_remove_items'        => __( 'Add or remove items', 'estry-edu-mar' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'estry-edu-mar' ),
		'popular_items'              => __( 'Popular Items', 'estry-edu-mar' ),
		'search_items'               => __( 'Search Countries', 'estry-edu-mar' ),
		'not_found'                  => __( 'Not Found', 'estry-edu-mar' ),
		'no_terms'                   => __( 'No items', 'estry-edu-mar' ),
		'items_list'                 => __( 'Countries list', 'estry-edu-mar' ),
		'items_list_navigation'      => __( 'Countries list navigation', 'estry-edu-mar' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'show_in_rest'               => true,
		'rest_base'                  => 'estry-edu-countries',
	);
	register_taxonomy( 'estry-edu-country', array( 'university' ), $args );

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

}