[wp-trac] [WordPress Trac] #56630: get_terms() does not recognize the 'slug' argument

WordPress Trac noreply at wordpress.org
Thu Sep 22 21:01:30 UTC 2022


#56630: get_terms() does not recognize the 'slug' argument
--------------------------+-----------------------------
 Reporter:  NemesisVex    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  6.0.2
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 Description

 When passing a slug to the get_terms() function, returned results are not
 filtered by that slug.

 Steps to reproduce

 1. In a theme template or plugin file, query for a known existing term in
 a taxonomy with get_terms(). For example: get_terms( [ 'taxonomy' =>
 'custom_tax_name', 'slug' => 'existing-slug'] );
 2. Dump the contents of the get_terms query.

 Expected outcome

 Results show only those terms matching the slug.

 Actual outcome

 Results show all terms in the taxonomy.

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


More information about the wp-trac mailing list