[wp-trac] [WordPress Trac] #35382: get_terms with set fields 'id=>parent' not return the id key

WordPress Trac noreply at wordpress.org
Sat Jan 9 05:22:07 UTC 2016


#35382: get_terms with set fields 'id=>parent' not return the id key
----------------------------------------+------------------------------
 Reporter:  fantasyworld                |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Taxonomy                    |     Version:  2.7.1
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => needs-patch good-first-bug
 * version:  4.4.1 => 2.7.1


Old description:

> when use the id=>parent with number and fields in id=>name or and other
> id=>xx type.
> In same case if the query return $terms array items in bigger then the
> number in you set with call the function.
> It use the {{{#!php
> <?php
> array_slice( $terms, $offset, $number );
> }}}
> to cat the array into number you want
> But this cat action will let the array id reset to 0, 1, 2 ... NOT the id
> of the term
> may use the {{{#!php
> <?php
> array_slice( $terms, $offset, $number, true );
> }}}
> to keep the old id in the new array

New description:

 when use the id=>parent with number and fields in id=>name or and other
 id=>xx type.
 In same case if the query return $terms array items in bigger then the
 number in you set with call the function.
 It use the
 {{{#!php
 <?php
 array_slice( $terms, $offset, $number );
 }}}
 to cat the array into number you want
 But this cat action will let the array id reset to 0, 1, 2 ... NOT the id
 of the term
 may use the
 {{{#!php
 <?php
 array_slice( $terms, $offset, $number, true );
 }}}
 to keep the old id in the new array

--

Comment:

 Introduced with [10416]

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


More information about the wp-trac mailing list