Opened 9 years ago
Closed 9 years ago
#30700 closed defect (bug) (invalid)
get_terms throws PHP notice when fields is set to 'id=>name'
Reported by: | webgeekconsulting | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0.1 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
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.
In 4.1, 'count' will be selected for all values of 'fields'. See [29845] #29859. So this problem should disappear.