#29131 closed defect (bug) (duplicate)
Does not allow duplicate term slugs when using different cases
| Reported by: | jpswade | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 3.9.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
12 years ago
- Component Rewrite Rules → Taxonomy
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
#2
@
12 years ago
- Resolution duplicate
- Status closed → 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
@
12 years ago
- Keywords close added
- Milestone → 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
@
12 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #22226.
See #5809.