Age Ranges Custom Taxonomy
This Taxonomy serves as a way to add age range tags for multiple post types throughout a site.
if ( ! function_exists( 'hms_taxonomies' ) ) { // Register Custom Taxonomy function hms_taxonomies() { $labels = array( 'name' => _x( 'Ages', 'Taxonomy General Name', 'hms-custom-post-types' ), 'singular_name' => _x( 'Age', 'Taxonomy Singular Name', 'hms-custom-post-types' ), 'menu_name' => __( 'Age Ranges', 'hms-custom-post-types' ), 'all_items' => __( 'All Age Ranges', 'hms-custom-post-types' ), 'parent_item' => __( 'Parent Age Range', 'hms-custom-post-types' ), 'parent_item_colon' => __( 'Parent Age Range:', 'hms-custom-post-types' ), 'new_item_name' => __( 'New Age Range', 'hms-custom-post-types' ), 'add_new_item' => __( 'Add New Age Range', 'hms-custom-post-types' ), 'edit_item' => __( 'Edit Age Range', 'hms-custom-post-types' ), 'update_item' => __( 'Update Item', 'hms-custom-post-types' ), 'view_item' => __( 'View Age Range', 'hms-custom-post-types' ), 'separate_items_with_commas' => __( 'Age Ranges with commas.', 'hms-custom-post-types' ), 'add_or_remove_items' => __( 'Add or remove Age Ranges', 'hms-custom-post-types' ), 'choose_from_most_used' => __( 'Choose from the most used', 'hms-custom-post-types' ), 'popular_items' => __( 'Popular Age Ranges', 'hms-custom-post-types' ), 'search_items' => __( 'Search Age Ranges', 'hms-custom-post-types' ), 'not_found' => __( 'Age Range Not Found', 'hms-custom-post-types' ), 'no_terms' => __( 'No Age Ranges', 'hms-custom-post-types' ), 'items_list' => __( 'Age Ranges list', 'hms-custom-post-types' ), 'items_list_navigation' => __( 'Age Ranges list navigation', 'hms-custom-post-types' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => false, 'show_tagcloud' => true, ); register_taxonomy( 'ages', array( 'events', 'library_databases', 'post' ), $args ); } add_action( 'init', 'hms_taxonomies', 0 ); }