mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Don't reset index keys when trimming results of term queries.
`array_slice()` must be told to preserve keys when the query results exceed the limit specified the 'number' parameter, so that `id=>parent` and other id-indexed return value formats don't get mangled. Props fantasyworld, wpdelighter. Fixes #35382. Built from https://develop.svn.wordpress.org/trunk@36252 git-svn-id: http://core.svn.wordpress.org/trunk@36219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cfae56d2c2
commit
909470db67
@ -1604,7 +1604,7 @@ function get_terms( $taxonomies, $args = '' ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $number && is_array( $terms ) && count( $terms ) > $number ) {
|
if ( $number && is_array( $terms ) && count( $terms ) > $number ) {
|
||||||
$terms = array_slice( $terms, $offset, $number );
|
$terms = array_slice( $terms, $offset, $number, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
|
wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-alpha-36251';
|
$wp_version = '4.5-alpha-36252';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user