diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-14 16:56:46 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-14 16:56:46 +0000 |
| commit | 6a5b25251eb16dc8da58816eb41e806197fe8a43 (patch) | |
| tree | 714721e87986d7a254175b4a70f76a3a591e0ffb /wp-inst/wp-includes/template-functions-post.php | |
| parent | 39854b3d3a80e4ac2bfee92a4b1210852baa7091 (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@525 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/template-functions-post.php')
| -rw-r--r-- | wp-inst/wp-includes/template-functions-post.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/wp-inst/wp-includes/template-functions-post.php b/wp-inst/wp-includes/template-functions-post.php index 07cfd14..bd0bcce 100644 --- a/wp-inst/wp-includes/template-functions-post.php +++ b/wp-inst/wp-includes/template-functions-post.php @@ -312,11 +312,16 @@ function &get_pages($args = '') { } } - $pages = $wpdb->get_results("SELECT * " . + $q = "SELECT * " . "FROM $wpdb->posts " . "WHERE post_type = 'page' AND post_status = 'publish' " . "$exclusions " . - "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']); + "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']; + + if ( !$pages = wp_cache_get( md5( $q ), 'general') ) { + $pages = $wpdb->get_results($q); + wp_cache_set( md5( $q ), $pages, 'general', 180); + } if ( empty($pages) ) return array(); |
