[wp-trac] [WordPress Trac] #47099: term_exists fail when term is surrounded with brackets
WordPress Trac
noreply at wordpress.org
Fri May 10 15:48:36 UTC 2019
#47099: term_exists fail when term is surrounded with brackets
-------------------------------------+------------------------------
Reporter: leogermani | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Resolution:
Keywords: close reporter-feedback | Focuses:
-------------------------------------+------------------------------
Comment (by leogermani):
Hi @boonebgorges ,
As I mentioned in #45333, `get_term_by()` is not a complete replacement
for `term_exists()` because it does not expect `parent` as a parameter, so
you can not achieve everything `term_exists()` was supposed to do.
But I completely agree with you when you say: "But any change of this sort
is highly likely to break someone's existing code that depends on the
existing idiosyncracies of `term_exists()`." This is a very good way to
put it :)
So maybe, and just maybe, we could create a new version of this method,
with another name, and deprecate current `term_exists()` in favor of this
new one... And check how the core uses it.
Do you believe there is any chance that people would like this approach?
Am I the only one bothered by `term_exists()` idiosyncracies? :)
cheers!
just as an example: in my plugin I had to implement my own version of
`term_exists` because I cant rely on the native function.
(https://github.com/tainacan/tainacan/blob/develop/src/classes/repositories
/class-tainacan-terms.php#L293)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47099#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list