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
This commit is contained in:
parent
59b3c1ce47
commit
c974ff5406
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user