Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

PSH: Service Area Tax

if ( ! function_exists( 'tax_service_area' ) ) {

// Register Custom Taxonomy
function tax_service_area() {

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

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

}