From 2af150e496fd37b0bea1442e5ca7b94a2711a899 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 8 Aug 2007 04:24:44 +0000 Subject: [PATCH] Avoid running get_posts filter twice. Props DD32. fixes #4712 git-svn-id: http://svn.automattic.com/wordpress/trunk@5855 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 f400190b3..0e4070d71 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; }