Opened 12 years ago
Closed 12 years ago
#30700 closed defect (bug) (invalid)
get_terms throws PHP notice when fields is set to 'id=>name'
| Reported by: | webgeekconsulting | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 4.0.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
The following code will raise a notice in PHP version 5.3.27
get_terms( 'category', array( 'fields' => 'id=>name' ) );
Notice: Undefined property: stdClass::$count in wp-includes/taxonomy.php on line 1590
It seems this is because the field "count" is not returned as part of the result set.
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 4.1, 'count' will be selected for all values of 'fields'. See [29845] #29859. So this problem should disappear.