Fix sticky post handling. Use unset instead of array_splice to remove an item by key retrieved by array_search. props jeffstieler, fixes #11966.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
efe0a28c18
commit
f87c42f038
|
@ -2462,7 +2462,7 @@ class WP_Query {
|
|||
$sticky_offset++;
|
||||
// Remove post from sticky posts array
|
||||
$offset = array_search($sticky_post->ID, $sticky_posts);
|
||||
array_splice($sticky_posts, $offset, 1);
|
||||
unset( $sticky_posts[$offset] );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue