Я бы зарегистрировал кастомный post type
human и две таксономии к нему
city и
activity
Как-то так:
if ( ! function_exists( 'init_register_post_types_callback' ) ) {
/**
* Function for 'init` action-hook.
*
* @return void
*/
function init_register_post_types_callback() {
register_taxonomy( 'city', array( 'human' ), array(
'labels' => array(
'name' => _x( 'Cities', 'taxonomy general name', 'domainname' ),
'singular_name' => _x( 'City', 'taxonomy singular name', 'domainname' ),
'search_items' => __( 'Search city', 'domainname' ),
'popular_items' => __( 'Popular cities', 'domainname' ),
'all_items' => __( 'All cities', 'domainname' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit city', 'domainname' ),
'update_item' => __( 'Update city', 'domainname' ),
'add_new_item' => __( 'Add new city', 'domainname' ),
'new_item_name' => __( 'New city', 'domainname' ),
'separate_items_with_commas' => __( 'Separate city with commas', 'domainname' ),
'add_or_remove_items' => __( 'Add or remove city', 'domainname' ),
'choose_from_most_used' => __( 'Choose from the most used cities', 'domainname' ),
'menu_name' => __( 'Cities', 'domainname' ),
),
'public' => true,
'show_in_nav_menus' => false,
'show_in_rest' => true,
'show_in_quick_edit' => true,
'sort' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => 'city', 'hierarchical' => false, 'with_front' => false, 'feed' => false ),
'show_admin_column' => true,
) );
register_taxonomy( 'activity', array( 'human' ), array(
'labels' => array(
'name' => _x( 'Activities', 'taxonomy general name', 'domainname' ),
'singular_name' => _x( 'Activity', 'taxonomy singular name', 'domainname' ),
'search_items' => __( 'Search activities', 'domainname' ),
'all_items' => __( 'All activities', 'domainname' ),
'parent_item' => __( 'Parent activities', 'domainname' ),
'parent_item_colon' => __( 'Parent activities:', 'domainname' ),
'edit_item' => __( 'Edit activities', 'domainname' ),
'update_item' => __( 'Update activities', 'domainname' ),
'add_new_item' => __( 'Add new activities', 'domainname' ),
'new_item_name' => __( 'New activities Name', 'domainname' ),
'menu_name' => __( 'Activities', 'domainname' ),
),
'public' => true,
'show_in_nav_menus' => false,
'show_in_rest' => true,
'show_in_quick_edit' => true,
'sort' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => 'activity', 'hierarchical' => false, 'with_front' => false, 'feed' => false ),
'show_admin_column' => true,
) );
register_post_type( 'human', array(
'labels' => array(
'name' => __( 'Humans', 'domainname' ),
'singular_name' => __( 'Human', 'domainname' ),
'add_new' => __( 'Add human', 'domainname' ),
'add_new_item' => __( 'Add new human', 'domainname' ),
'edit_item' => __( 'Edit human', 'domainname' ),
'new_item' => __( 'New human', 'domainname' ),
'view_item' => __( 'View human', 'domainname' ),
'search_items' => __( 'Search human', 'domainname' ),
'not_found' => __( 'Human not found', 'domainname' ),
'not_found_in_trash' => __( 'Human not found in trash', 'domainname' ),
'menu_name' => __( 'Human', 'domainname' ),
),
'public' => true,
'show_in_rest' => true,
'capability_type' => 'post',
'hierarchical' => false,
'has_archive' => 'humans',
'rewrite' => array( 'slug' => 'humans', 'with_front' => false, 'pages' => true, 'feeds' => false, 'feed' => false ),
'query_var' => true,
'supports' => array( 'page-attributes', 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields' ),
'taxonomies' => array( 'activities' ),
) );
}
}
add_action( 'init', 'init_register_post_types_callback' );