#44221 closed defect (bug) (fixed)
`get_terms()` with `all_with_object_id` returns cached `stdClass` objects
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.9.7 | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | Taxonomy | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Two identical calls to get_terms() with 'fields' => 'all_with_object_id' will return an array of WP_Term objects for the first call but an array of stdClass objects for the second call if the objects are retrieved from the cache.
It looks to me like this was caused by a missed case of updating
if ( 'all' === $_fields )
to
if ( 'all' === $_fields || 'all_with_object_id' === $_fields )
in [38667]. It seems unintentional, but I might be missing something.
The attached patch includes a test demonstrating the issue and a potential patch.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Good catch, @dlh. This does appear to be a mistake in [38667].