Ticket #21309: 21309-get_adjacent_post.diff
File 21309-get_adjacent_post.diff, 811 bytes (added by , 13 years ago) |
---|
-
wp-includes/link-template.php
1175 1175 $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort"; 1176 1176 $query_key = 'adjacent_post_' . md5($query); 1177 1177 $result = wp_cache_get($query_key, 'counts'); 1178 if ( false !== $result ) 1178 if ( false !== $result ) { 1179 if ( is_object( $result ) ) 1180 $result = new WP_Post( $result ); 1179 1181 return $result; 1182 } 1180 1183 1181 1184 $result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort"); 1182 1185 if ( null === $result ) 1183 1186 $result = ''; 1184 1187 1185 1188 wp_cache_set($query_key, $result, 'counts'); 1189 1190 if ( is_object( $result ) ) 1191 $result = new WP_Post( $result ); 1192 1186 1193 return $result; 1187 1194 } 1188 1195