[wp-trac] [WordPress Trac] #59478: term_exists() to return false if no terms exist

WordPress Trac noreply at wordpress.org
Wed Sep 27 13:51:31 UTC 2023


#59478: term_exists() to return false if no terms exist
-------------------------+------------------------------
 Reporter:  rossb2       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by sabernhardt):

 * component:  General => Taxonomy


Old description:

> When using the function term_exists() in wp-includes/taxonomy.php, it
> returns null if no terms exist. This behaviour seems incorrect and is
> inconsistent with other similar functions in the same file
> (taxonomy_exists() is one example).
>
> It would make more sense to return false.

New description:

 When using the function `term_exists()` in `wp-includes/taxonomy.php`, it
 returns `null` if no terms exist. This behaviour seems incorrect and is
 inconsistent with other similar functions in the same file
 (`taxonomy_exists()` is one example).

 It would make more sense to return `false`.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59478#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list