[wp-trac] [WordPress Trac] #47099: term_exists fail when term is surrounded with brackets
WordPress Trac
noreply at wordpress.org
Tue May 7 21:38:06 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: | Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):
* component: General => Taxonomy
Old description:
> Steps to reproduce:
>
> 1. Create a term. For example `test`.
> 2. run `term_exists('[test]', $taxonomy)`
>
> Expected result: It should return `false`, because it is a different term
>
> Actual result: It returns the `test` term.
>
> This issue is related to https://core.trac.wordpress.org/ticket/45333
> where there are more details around the discussions in regard to
> `term_exists` inconsistencies. Basically this function handles the term
> name string in a different way that `wp_insert_term()` does.
>
> If someone could review it and agree we should work on a fix for
> term_exists I could do this, writing also the related tests.
>
> Cheers.
New description:
Steps to reproduce:
1. Create a term. For example `test`.
2. run `term_exists('[test]', $taxonomy)`
Expected result: It should return `false`, because it is a different term
Actual result: It returns the `test` term.
This issue is related to #45333 where there are more details around the
discussions in regard to `term_exists` inconsistencies. Basically this
function handles the term name string in a different way that
`wp_insert_term()` does.
If someone could review it and agree we should work on a fix for
term_exists I could do this, writing also the related tests.
Cheers.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47099#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list