From f87c42f03802c5990672e9e9ca27ffb8ec041381 Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@14135 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 f2616312a..d42ed3092 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] ); } }