Opened 13 years ago
Closed 12 years ago
#25234 closed defect (bug) (wontfix)
wp_create_term is defined in the wrong file
| Reported by: | johnbillion | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 2.8 |
| Severity: | normal | Keywords: | has-patch 2nd-opinion |
| Cc: | Focuses: |
Description
wp_create_term() is just a wrapper for a term_exists() check and wp_insert_term(), but it's defined in a file that's only included in the admin area. This means wp_create_term() can't be used on the front end without including wp-admin/includes/taxonomy.php. Not good.
Attachments (2)
Change History (8)
#4
@
12 years ago
- Keywords 2nd-opinion added
- Milestone 3.9 → Awaiting Review
wp_create_term() is kind of crappy. A "create" action should never silently return something existing. This seems like a bad pattern. I'd rather not introduce a generically named function into the main includes namespace. It'll just confuse new developers.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
25234.diff moves
wp_create_term()fromwp-admin/includes/taxonomy.phptowp-includes/taxonomy.phpwhere it belongs.