#12482 closed defect (bug) (fixed)
Correction to wp_insert_term() documentation
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
After tracing through the code to see if I actually could use the wp_insert_term() method to add an existing term in a new taxonomy by it's id, I found that the method's documentation for its $term was incorrect in accepting an INT value for the $term parameter. It is cast as a string within the function so a term_id can't be passed in for this param as one would suspect given the docs.
Attachments (1)
Change History (7)
#1
@
15 years ago
- Component changed from General to Inline Docs
- Milestone changed from 3.1 to 3.0
- Owner set to nacin
#2
@
15 years ago
- Component changed from Inline Docs to Taxonomy
- Owner changed from nacin to filosofo
This also reveals some dead code in there:
if ( is_int($term) && 0 == $term ) return new WP_Error('invalid_term_id', __('Invalid term ID'));
That should be removed if the rest of the function doesn't support term IDs.
#4
@
15 years ago
- Owner changed from nacin to dd32
I'm going to pass this off to dd32 for a review. I think we're good to both fix the docs and remove the dead code.
Note: See
TracTickets for help on using
tickets.
Inline docs remain fine for 3.0, in fact they are encouraged.