[wp-trac] [WordPress Trac] #42361: get_term returns NULL before filters
WordPress Trac
noreply at wordpress.org
Tue Nov 21 02:50:01 UTC 2017
#42361: get_term returns NULL before filters
-----------------------------------------+------------------------------
Reporter: socki03 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 4.7
Severity: minor | Resolution:
Keywords: has-patch reporter-feedback | Focuses:
-----------------------------------------+------------------------------
Comment (by boonebgorges):
Hi @socki03 - To expand a bit on the first point made above by @welcher,
the change you've proposed would mean that the `get_term` and
`get_{$taxonomy}` filters could in some cases receive an empty value
instead of a term object or an integer (as the documentation states). This
is likely to cause PHP notices in large numbers of plugins, and
potentially introduce more serious issues, at the same time that it fixes
the notices in the plugin you've referenced.
Out of curiosity, how does this change fix an error in cpt-onomies?
Looking briefly at the code, I don't see at a glance how the change would
make a difference. The plugin doesn't appear to use either of these
filters.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42361#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list