I’ve identified two issues, the first, this:
'rewrite' => true,
'rewrite' => array( 'slug' => 'districts' ),
Can just be this:
'rewrite' => array( 'slug' => 'districts' ),
And the second, the reason you get invalid menu items, is because districts is being used as the rewrite slug, but, the internal namevof the taxonomy is Districts.
Replacing Districts with districts as the internal name fixed the issue for me locally:
register_taxonomy( 'districts', array('post'), array(
It’s a general rule of thumb to keep internal names of things lower case, you can always use the labels for what the user sees
Related Posts:
- Get Current Menu Location inside Nav_Walker
- Add child pages to submenu automatically
- Create and style menu
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- How to hide or rename “X” and “x-child” references in website source?
- WordPress custom taxonomy check box to dropdown
- How to Get Current Custom Post Type Associated Taxonomy Term
- Custom code for WordPress dynamic menu
- Plugin templates vs Parent Theme
- Selectively update themes in WordPress multisite
- Widget HTML Display Problem
- How do I access the menus produced by Dashboard > Appearance > Menus
- How to create a backend for a custom theme?
- wp_nonce_field displaying twice
- Redirect to another page using contact form 7? [closed]
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- Is it necessary to do validation again when retrieving data from database?
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- WP Plugin Running before jQuery
- Template directory in plugin
- wordpress add_submenu_page adds broken link
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- 400 Bad Request, in wordpress theme development, wp_ajax
- WP Enqueue style on all plug-in pages
- Customize existing menu item
- Why in this archive page that call query_posts() function show only the last 10 posts?
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Why enqueue styles on hook?
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Issue with plugin sub menu and pages
- How to add Plugin functionality in WordPress Frontend Menus
- Does WordPress default CSS have Grids?
- Using HTML links within translatable string
- How to resize WordPress images on upload to specific height and width without cropping it
- Create fixed static pages
- How to get terms for taxonomy
- How to hide page links from theme menu
- WP_NAV_MENU filter targets all menus
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- How do I add a menu item to a Pods admin menu?
- WordPress Page Reload Takes forever during theme development
- Adjust query on single
- Setting a post’s category
- rewrite_rules problem
- Using password protection to load different page elements?
- Add user managable titles to custom menus?
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Why does website stretch and white space on load? [duplicate]
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to create archive page to add in menu
- Why my theme’s css not working on another site
- How to access index file in Block Themes?
- How to show comments from different Plugins to same post type?
- Pass custom props to
- How to show only the last two categories in a menu?
- Include external po file for 3th party plugin to theme
- WordPress Favicon not Working For Images/Videos/PDFs
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Override category archive page title (not the head title)
- How do I add filter with woocommerce categories?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section