[wp-trac] [WordPress Trac] #64357: get_terms() no longer returns terms when "include" or "exclude" is set to 'all' or an empty value in WP 6.9

WordPress Trac noreply at wordpress.org
Thu Dec 4 16:42:24 UTC 2025


#64357: get_terms() no longer returns terms when "include" or "exclude" is set to
'all' or an empty value in WP 6.9
--------------------------+-----------------------------
 Reporter:  ibachal       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  6.9
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After updating to WordPress 6.9, I noticed a regression in how get_terms()
 handles the include and exclude arguments.

 Previously (in WP 6.8 and earlier), the following usages worked without
 issue:


 {{{
 get_terms( [
     'taxonomy' => 'category',
     'include'  => 'all',
     'exclude'  => 'all',
 ] );

 get_terms( [
     'taxonomy' => 'category',
     'exclude'  => array(),
 ] );
 }}}

 Both returned the full list of terms, just as if include/exclude were not
 set.

 Since updating to WordPress 6.9, the same code now returns no terms at
 all.

 **Expected Behavior**

 When include = 'all' or an empty value, WordPress should treat it the same
 as omitting the argument and return all terms.

 This is the behavior in WP 6.8 and earlier.

 **Actual Behavior in WP 6.9**

 get_terms() returns an empty array when include or exclude is set to 'all'
 or empty.

 This breaks existing codebases and plugins that rely on passing 'all' or
 empty values dynamically.

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


More information about the wp-trac mailing list