From c974ff5406ff5d83bb8c85afa6e388978b4c8f40 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 8 Aug 2007 04:24:44 +0000 Subject: [PATCH] Avoid running get_posts filter twice. Props DD32. fixes #4712 git-svn-id: https://develop.svn.wordpress.org/trunk@5855 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index f400190b32..0e4070d715 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1183,7 +1183,6 @@ function &get_pages($args = '') { $query .= " ORDER BY " . $sort_column . " " . $sort_order ; $pages = $wpdb->get_results($query); - $pages = apply_filters('get_pages', $pages, $r); if ( empty($pages) ) return array(); @@ -1197,6 +1196,8 @@ function &get_pages($args = '') { $cache[ $key ] = $pages; wp_cache_set( 'get_pages', $cache, 'page' ); + $pages = apply_filters('get_pages', $pages, $r); + return $pages; }