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
This commit is contained in:
markjaquith 2007-08-08 04:24:44 +00:00
parent 773e23d2e6
commit 2af150e496

View File

@ -1183,7 +1183,6 @@ function &get_pages($args = '') {
$query .= " ORDER BY " . $sort_column . " " . $sort_order ; $query .= " ORDER BY " . $sort_column . " " . $sort_order ;
$pages = $wpdb->get_results($query); $pages = $wpdb->get_results($query);
$pages = apply_filters('get_pages', $pages, $r);
if ( empty($pages) ) if ( empty($pages) )
return array(); return array();
@ -1197,6 +1196,8 @@ function &get_pages($args = '') {
$cache[ $key ] = $pages; $cache[ $key ] = $pages;
wp_cache_set( 'get_pages', $cache, 'page' ); wp_cache_set( 'get_pages', $cache, 'page' );
$pages = apply_filters('get_pages', $pages, $r);
return $pages; return $pages;
} }