Changeset 36252
- Timestamp:
- 01/10/2016 04:05:26 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r36244 r36252 1605 1605 1606 1606 if ( $number && is_array( $terms ) && count( $terms ) > $number ) { 1607 $terms = array_slice( $terms, $offset, $number );1607 $terms = array_slice( $terms, $offset, $number, true ); 1608 1608 } 1609 1609 -
trunk/tests/phpunit/tests/term/getTerms.php
r36003 r36252 1666 1666 } 1667 1667 1668 /** 1669 * @ticket 35382 1670 */ 1671 public function test_indexes_should_not_be_reset_when_number_of_matched_terms_is_greater_than_number() { 1672 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 1673 $terms = self::factory()->term->create_many( 3, array( 'taxonomy' => 'wptests_tax' ) ); 1674 1675 $found = get_terms( 'wptests_tax', array( 1676 'hide_empty' => false, 1677 'fields' => 'id=>parent', 1678 'number' => 2, 1679 'orderby' => 'id', 1680 'order' => 'ASC', 1681 'hierarchical' => true, 1682 ) ); 1683 1684 $this->assertSame( array( $terms[0], $terms[1] ), array_keys( $found ) ); 1685 } 1686 1668 1687 protected function create_hierarchical_terms_and_posts() { 1669 1688 $terms = array();
Note: See TracChangeset
for help on using the changeset viewer.