From a8d984183f2a3feb0ad19ef7e9e44d0146678e2c Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 18 Apr 2010 05:11:05 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@14135 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index f2616312a1..d42ed30928 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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] ); } }