[wp-trac] [WordPress Trac] #28072: hide_featured_term always expects an array of term objects
WordPress Trac
noreply at wordpress.org
Wed Apr 30 10:31:45 UTC 2014
#28072: hide_featured_term always expects an array of term objects
---------------------------+-----------------------------
Reporter: jadpm | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: trunk
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
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).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28072>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list