diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-16 12:55:46 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-16 12:55:46 +0000 |
| commit | 2ab4faee68383698b06cc23eef6ce8f41612f58d (patch) | |
| tree | 5324a28a65ef148d30befb8d3ab38290d0118e8a /wp-inst/wp-includes/template-functions-post.php | |
| parent | 3274315bf43466070cd481ee2d08cf8114d3c8f7 (diff) | |
WP updates
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@528 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 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/wp-inst/wp-includes/template-functions-post.php b/wp-inst/wp-includes/template-functions-post.php index bd0bcce..1ccfa76 100644 --- a/wp-inst/wp-includes/template-functions-post.php +++ b/wp-inst/wp-includes/template-functions-post.php @@ -318,9 +318,12 @@ function &get_pages($args = '') { "$exclusions " . "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']; - if ( !$pages = wp_cache_get( md5( $q ), 'general') ) { + $cached_pages = wp_cache_get( md5( $q ), 'general'); + if ( is_array( $cached_pages ) == false || ( is_array( $cached_pages ) == true && ( get_option( 'pages_last_updated' ) != false && $cached_pages[ 'time' ] < get_option( 'pages_last_updated' ) ) ) ) { $pages = $wpdb->get_results($q); - wp_cache_set( md5( $q ), $pages, 'general', 180); + wp_cache_set( md5( $q ), array( 'pages' => $pages, 'time' => time() ), 'general', 600 ); + } else { + $pages = $cached_pages[ 'pages' ]; } if ( empty($pages) ) |
