[wp-trac] [WordPress Trac] #47099: term_exists fail when term is surrounded with brackets

WordPress Trac noreply at wordpress.org
Thu May 2 17:10:27 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:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47099>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list