Opened 14 years ago
Closed 14 years ago
#16951 closed defect (bug) (fixed)
register_taxonomy_for_object_type() sets duplicate values
Reported by: | kevinB | Owned by: | scribu |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | minor | Version: | 3.1 |
Component: | Taxonomy | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
If register_taxonomy_for_object_type() is called for an object type which is already present in the taxonomy's object_type array, a duplicate value is added to the array.
This is a common occurrence with user-modifiable taxonomy/type definition in plugins such as GD Custom Posts and Taxonomies, when:
- register_taxonomy() is called with object_type argument, based on a taxonomy configuration.
- register_taxonomy_for_object_type() is subsequently called, based on a post type configuration.
Attachments (1)
Change History (5)
#1
@
14 years ago
- Owner set to scribu
- Severity changed from normal to minor
- Status changed from new to reviewing
#2
@
14 years ago
It can cause redundant processing or duplicate/erroneous UI generation in taxonomy-related plugins.
You're right to flag it as minor, but it's also a minor fix. My thinking is if $tx->object_type is supported API, are duplicate object_type values ever appropriate and if not, why leave validation to the client?
Note: See
TracTickets for help on using
tickets.
Do duplicates there actually have any adverse effects?