[wp-trac] [WordPress Trac] #57380: [documentation] get_terms basic usage order

WordPress Trac noreply at wordpress.org
Tue Dec 27 12:21:50 UTC 2022


#57380: [documentation] get_terms basic usage order
---------------------------+-----------------------------
 Reporter:  ramon fincken  |       Owner:  SergeyBiryukov
     Type:  enhancement    |      Status:  closed
 Priority:  normal         |   Milestone:  6.2
Component:  Taxonomy       |     Version:  4.5
 Severity:  normal         |  Resolution:  fixed
 Keywords:  has-patch      |     Focuses:  docs
---------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55018" 55018]:
 {{{
 #!CommitTicketReference repository="" revision="55018"
 Docs: Remove the legacy example of passing a taxonomy to `get_terms()`.

 As of WordPress 4.5, taxonomies should be passed to `get_terms()` via the
 `taxonomy` argument in the `$args` array:
 {{{
 $terms = get_terms( array(
     'taxonomy'   => 'post_tag',
     'hide_empty' => false,
 ) );
 }}}

 The legacy way of passing a taxonomy via the function's first parameter
 was still mentioned in the documentation, causing some confusion.

 This commit updates the function documentation to better highlight the
 currently recommended approach.

 Follow-up to [36614].

 Props ramon-fincken, sabernhardt, SergeyBiryukov.
 Fixes #57380.
 }}}

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


More information about the wp-trac mailing list