My approach would be:
- Hide city edition metabox, by setting
public
to false. - I would override how metabox for country should render by using
meta_box_cb
parameter. You should provide callback for the function that will do the render. - In this function, you first render the field for country, and then on choose you make an AJAX request to your backend to gather a list of the cities for the provided country.
Related Posts:
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- Is There a Difference Between Taxonomies and Categories?
- Only one category per post
- Is there an easy way to make a meta box have the tabs like the Categories meta box has?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- get_categories for custom post type with a specific custom taxonomy attached
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- Could not insert term into the database
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- Weird behaviour when adding terms/term_taxonomies programmatically
- wp_update_nav_menu_item() to insert categories
- How to create non-unique sub-category slugs?
- Need help adding custom field to category
- How to get next previous category in same taxonomy?
- Display only deepest category on a single post?
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- Wrap a chosen category name with div
- Category Search functionality on category metabox (wordpress admin)
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Update taxonomy value of post type in query
- How to query posts from specific authors and categories using WP_query?
- Add custom taxonomy under the category title
- Display name of the last child category
- How to remove the “+Add Category” button from the Category metabox?
- List Terms in Category
- How to get category URL with the slug?
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- Display Slug instead of Name
- ACF: Display category name using taxonomy field
- Show Available Taxonomy List with Current Category
- Exclude a category from the_category in the single post page
- Taxonomy name repeating when showing 2 posts from each category
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Shortcodes not working in category or tag description
- Filtering multiple categories via the URL
- Display specific categories by ID
- Display Posts Loop for each parent and for each Child
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- Custom taxonomy template for categories
- Wacky taxonomy in wordpress
- Display custom taxonomy attached to the post on post single page
- Question on using custom structures for categories
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- Display sibling categories on category page
- Echo text using is_tag
- WP 4.7 in_category change?
- Get posts of a custom post type from category from taxonomy?
- Illegal string offset ‘taxonomy’ in
- How to restrict the amount of categories/post tags/terms for a post type post
- Change categories count to include media attachments
- How to get selected taxonomy or category ID if using custom walker?
- Custom meta boxes ID prefix showing on first category but not others
- Let user select their own category
- Setting selected term_id with wp_dropdown_categories?
- creating categories programmatically
- WP Category Meta plugin fix? [closed]
- how can we bring category metabox to Media Library/Upload New Media Page
- create relationship between posts from one category and posts from another category
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- Category post count is not correct
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Show subChild categories
- How can i change sort category view starting from child then parent, not alphabetically
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- Taxonomy custom check box meta field not getting saved
- WordPress Portofolio Conditional Templating – functions php
- Get WooCommerce product category list in functions.php
- Bulk assign posts to a category using SQL (MySQL)
- outputting taxonomy hierarchy
- Confused about category.php template – not working
- Filter custom taxonomy posts via AJAX
- Why use hierarchical taxonomies instead of many custom taxonomies?
- How get all media from a posts category by db?
- How can I add metaboxs to Admin Bar?
- How to Manage and link certain custom taxonomy?
- Display Taxonomies in loop with template args
- Grouping parent categories into sections
- Match two taxonomies to display a specific content
- Display only the latest post
- Return selected categories only in custom page meta box?
- How to add all categories into an array and extract the categories names and use it with a custom meta box
- list taxonomy based on taxonomy
- get IDs from links categories
- Multiple Parent Category URLs
- Chained drop-down menu for custom taxonomy using chained.js
- Display only one level subcategory in wordpress
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy term RestApi data 10 rows limitions
- Images as Categories
- How can I get the categories and subcategories separately?