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
- Can I add a Category Metabox to attachment?
- 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?
- Control term order on a per-post basis
- 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]
- Can a Child Category Have More than One Parent?
- Combine two taxonomies in a hierarchical tree
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I select a primary category?
- wp_update_nav_menu_item() to insert categories
- Changing Top Level Items into Radio Buttons in the Categories Meta Box?
- How to make custom taxonomy check boxes like ‘Categories’
- Create terms when registering taxonomy?
- How to Make a Categories Meta Box with Hierarchical Checkboxes on Frontend?
- How to create non-unique sub-category slugs?
- Add search to list of categories in post editor
- 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?
- How to Override default update_count_callback for category
- Wrap a chosen category name with div
- Save metabox checkboxes values to custom content type
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- wp_list_categories, Add class to all list items with children
- Getting WordPress custom taxonomy/category?
- Display empty taxonomy terms with get_terms()
- Category Search functionality on category metabox (wordpress admin)
- Return category slug / title from category ID
- WP 3.0.5: Best way to add custom metaboxes for post categories?
- Connecting WordPress gallery to custom categories (taxonomy)
- How to get the number of child categories a specific parent category has?
- Render Selected Categories in Admin Edit Post Screen differently
- Get term by slug in Gutenberg
- 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?
- How to get the depth of a category’s subcategories
- New categories are now going to 404s
- How can I convert some categories to a custom taxonomy?
- Any way to assign Post Categories and Tags to Links?
- Add custom taxonomy under the category title
- Display name of the last child category
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- Get multidimensional array that reflects category hierarchy
- How to remove the “+Add Category” button from the Category metabox?
- How to export/import categories and keep their IDs?
- How to use wp_category_checklist()?
- List Terms in Category
- How to get category URL with the slug?
- Get all sub-categories of a parent category
- Can I use get_adjacent_post for specific categories?
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- Taxonomy filter all children
- Display Slug instead of Name
- Force a user’s posts category
- Search Posts / Pages with multiple options?
- Change existing taxonomy settings when using custom taxonomy
- ACF: Display category name using taxonomy field
- Category pie diagram meta box in post editing page
- How to get the id from the custom category?
- Show Available Taxonomy List with Current Category
- category filter doesn’t work in WPML
- How to filter out Categories for specific post types on WordPress Admin?
- Limit a meta box to a specific category
- Automatically exclude categories from metabox based on title
- Exclude a category from the_category in the single post page
- How can i insert term in a specific language of Polylang?
- Taxonomy name repeating when showing 2 posts from each category
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- New Categories Not Shown In the Post Edit Page
- 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
- Filtering *out* a taxonomy from the admin post list
- category image taxonomy
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Use Tag input metabox style for Categories
- Custom taxonomy/category order
- Why don’t posts show up in my categories on the frontend?
- Flat category URLs but retaining hierarchy?
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies