Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Property Types

if ( ! function_exists( 'property_type' ) ) {

// Register Custom Taxonomy
function property_type() {

	$labels = array(
		'name'                       => _x( 'Property Types', 'Taxonomy General Name', 'property_type' ),
		'singular_name'              => _x( 'Property Type', 'Taxonomy Singular Name', 'property_type' ),
		'menu_name'                  => __( 'Property Type', 'property_type' ),
		'all_items'                  => __( 'All Property Types', 'property_type' ),
		'parent_item'                => __( 'Parent Property Type', 'property_type' ),
		'parent_item_colon'          => __( 'Parent Property Type:', 'property_type' ),
		'new_item_name'              => __( 'New Property Type Name', 'property_type' ),
		'add_new_item'               => __( 'Add New Property Type', 'property_type' ),
		'edit_item'                  => __( 'Edit Property Type', 'property_type' ),
		'update_item'                => __( 'Update Property Type', 'property_type' ),
		'view_item'                  => __( 'View Property Type', 'property_type' ),
		'separate_items_with_commas' => __( 'Separate Property Types with commas', 'property_type' ),
		'add_or_remove_items'        => __( 'Add or remove Property Types', 'property_type' ),
		'choose_from_most_used'      => __( 'Choose from the most used Property Types', 'property_type' ),
		'popular_items'              => __( 'Popular Property Types', 'property_type' ),
		'search_items'               => __( 'Search Property Types', 'property_type' ),
		'not_found'                  => __( 'Property Type Not Found', 'property_type' ),
		'no_terms'                   => __( 'No Property Types', 'property_type' ),
		'items_list'                 => __( 'Property Types list', 'property_type' ),
		'items_list_navigation'      => __( 'Property Types list navigation', 'property_type' ),
	);
	$rewrite = array(
		'slug'                       => 'property-type',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'property_type', array( 'properties' ), $args );

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

}