Changeset 11241
- Timestamp:
- 05/08/2009 06:04:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r11218 r11241 869 869 global $post, $wpdb; 870 870 871 if ( empty($post) || !is_single() || is_attachment() )871 if ( empty($post) || !is_single() || is_attachment() ) 872 872 return null; 873 873 … … 906 906 $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 907 907 908 return $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort"); 908 $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort"; 909 $query_key = 'adjacent_post_' . md5($query); 910 $result = wp_cache_get($query_key, 'counts'); 911 if ( false !== $result ) 912 return $result; 913 914 $result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort"); 915 wp_cache_set($query_key, $result, 'counts'); 916 return $result; 909 917 } 910 918
Note: See TracChangeset
for help on using the changeset viewer.