#28072 closed defect (bug) (fixed)
Twenty Fourteen: hide_featured_term always expects an array of term objects
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.0 | Priority: | normal |
| Severity: | normal | Version: | 3.8 |
| Component: | Bundled Theme | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
twentyfourteen/inc/featured-content.php contains a filter on the 'get_terms' hook: hide_featured_term (line 315) that is always expecting an array of term objects to be passed. This filter is used to "hide featured tag from displaying when global terms are queried from the front-end" as its inline documentation states.
However, get_terms() can use a 'fields' argument that will make that filter be feeded with an array of IDs, names or even a simple term count, among other options. When using get_terms() in the frontend to get anything but term objects, this filter hide_featured_term produces a PHP notice.
The main problem to solve here is that when querying for anything different from term objects using multiple taxonomies, there is no way of knowing the actual taxonomy each term belongs to, so we might not be able to separate post_tag terms from terms in other taxonomy. This could make unsetting featured tags from the list of returned terms impossible (or at least quite expensive), unless term IDs and term names are both unique (which I think is not the case).
Attachments (1)
Change History (6)
#1
@
12 years ago
- Summary changed from hide_featured_term always expects an array of term objects to Twenty Fourteen: hide_featured_term always expects an array of term objects
- Version changed from trunk to 3.8
28072.patch fixes the PHP notice.