#14590 closed defect (bug) (fixed)
get_queried_object_id does not return an int for taxonomy terms
Reported by: | GamajoTech | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | minor | Version: | 3.0.1 |
Component: | Taxonomy | Keywords: | has-patch needs-testing gsoc |
Focuses: | Cc: |
Description
The docblock for get_queried_object_id() claims it returns as an integer. However, when the queried object is such that is_tax() as true, it's returned as a string.
The following line (currently line 2739 of wp-includes/query.php in WP 3.0.1) needs changing within get_queried_object() from:
$this->queried_object_id = $term->term_id;
to
$this->queried_object_id = (int) $term->term_id;
Attachments (1)
Change History (8)
#1
@
14 years ago
- Cc wojtek.szkutnik@… added
- Keywords has-patch needs-testing gsoc added; taxonomy get_queried_object removed
#3
@
14 years ago
- Cc gary@… added
Thanks for taking a look and attaching a patch (I really should learn how to do that, especially for something so trivial!).
Note: See
TracTickets for help on using
tickets.
Clearly someone must have forgotten the (int) part. I double checked the rest of the code, it seems it's the only place where the problem appears.