#29131 closed defect (bug) (duplicate)
Does not allow duplicate term slugs when using different cases
Reported by: | jpswade | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9.1 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Steps to reproduce:
- Go to Posts>Categories add new category with the name 'Banana'
- Go to Posts>Tags add new tag with the name 'BANANA'
This will result in a Category called Banana with the slug 'banana' and a Tag called 'BANANA' and the slug 'banana-2'.
Change History (7)
#1
@
10 years ago
- Component changed from Rewrite Rules to Taxonomy
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#2
@
10 years ago
- Resolution duplicate deleted
- Status changed from closed to reopened
Please refer to the steps provided above then compare to the steps provided in issue #5809.
These are different issues, the issue here is specific to case, specifically when using all uppercase.
#3
@
10 years ago
- Keywords close added
- Milestone set to Awaiting Review
This will result in a Category called Banana with the slug 'banana' and a Tag called 'BANANA' and the slug 'banana-2'.
This appears to be the expected result, see the description of wp_unique_term_slug().
The $slug has to be unique global to every taxonomy, meaning that one taxonomy term can't have a matching slug with another taxonomy term. Each slug has to be globally unique for every taxonomy.
The case of the term name doesn't matter.
We do create shared terms if there's an exact match (see #5809, #21950, #23199), but the plan is to get rid of them: http://make.wordpress.org/core/2013/07/28/potential-roadmap-for-taxonomy-meta-and-post-relationships/.
#4
@
10 years ago
Try this:
- Go to Post>Category (/wp-admin/edit-tags.php?taxonomy=category)
- In the 'Name' field enter: Banana
- Press "Add New Category" button
- Go to Post>Tag (/wp-admin/edit-tags.php?taxonomy=post_tag)
- In the 'Name' field enter: Banana
- Press "Add New Tag" button
- Observe the 'Slug' is 'banana'
- Delete the tag 'Banana'
- Go to Post>Tag (/wp-admin/edit-tags.php?taxonomy=post_tag)
- In the 'Name' field enter: BANANA
- Press "Add New Tag" button
- Observe that the 'Slug' for the 'BANANA' Tag is 'banana-2'
The case of the term does seem to matter as the results are different.
Duplicate of #22226.
See #5809.