I have created a custom taxonomy with the basic code below. I created a term called 'video' some time ago to test it. I created a few other terms today then noticed that I cannot delete or edit that first created term 'video'. It is grayed out and offers only the view link, which is a broken link. Oddly, using the correct permalink structure, the page for the 'video' term does display as expected.
I can create and edit other terms without any errors. There's also no errors anywhere else in the WP admin pages.
UPDATE:
After troubleshooting, I believe the issue is because I initially created the custom taxonomy with the name Purpose
, but then changed it to purpose
. Calling $object->taxonomy
returns Purpose
, while all the others listed in the admin panel return purpose
.
How can I change this term's taxonomy from Purpose
to purpose
?
Here is the function that creates the taxonomy:
function post_purpose_taxonomy()
{
$args = array (
'labels' => array('name' => 'Purpose Tags', 'singular_name' => 'Purpose Tag'),
'hierarchical' => false,
'public' => true,
);
register_taxonomy('purpose', [ 'post', 'dvposts' ], $args);
}
add_action('init', 'post_purpose_taxonomy');
You can see that I register the taxonomy to both posts and the custom post type 'dvposts'.
Here is a snapshot:
register_taxonomy
call is very small, normally there are a lot more options declared. I also notice that you make an extra call toregister_taxonomy_for_object_type
rather than just passing[ 'post', 'dvposts' ]
as the second parameter. Have you disabled all plugins and confirmed that none of them cause this? Or that this still happens in a blank clean slate WP install with the default theme and that code?[ 'post', 'dvposts' ]
inregister_taxonomy
instead and see what happens.register_taxonomy('purpose', [ 'post', 'dvposts' ], $args);
and removedregister_taxonomy_for_object_type
. That did not work. Also just tried passing'capabilities' => array ('manage_terms','edit_terms','delete_terms','assign_terms')
and no luck.