#14590 closed defect (bug) (fixed)
get_queried_object_id does not return an int for taxonomy terms
| Reported by: | GamajoTech | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Taxonomy | Version: | 3.0.1 |
| Severity: | minor | Keywords: | has-patch needs-testing gsoc |
| Cc: | Focuses: |
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
@
16 years ago
- Cc added
- Keywords has-patch needs-testing gsoc added; taxonomy get_queried_object removed
#3
@
16 years ago
- Cc 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.