Ticket #18120: 18120.diff
| File 18120.diff, 1.4 KB (added by nacin, 8 months ago) |
|---|
-
wp-includes/link-template.php
1166 1166 $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories ); 1167 1167 $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 1168 1168 1169 $query = "SELECT p. *FROM $wpdb->posts AS p $join $where $sort";1169 $query = "SELECT p.id FROM $wpdb->posts AS p $join $where $sort"; 1170 1170 $query_key = 'adjacent_post_' . md5($query); 1171 1171 $result = wp_cache_get($query_key, 'counts'); 1172 1172 if ( false !== $result ) { 1173 if ( is_object( $result ))1174 $result = new WP_Post( $result );1173 if ( $result ) 1174 $result = get_post( $result ); 1175 1175 return $result; 1176 1176 } 1177 1177 1178 $result = $wpdb->get_ row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort");1178 $result = $wpdb->get_var( $query ); 1179 1179 if ( null === $result ) 1180 1180 $result = ''; 1181 1181 1182 1182 wp_cache_set($query_key, $result, 'counts'); 1183 1183 1184 if ( is_object( $result ))1185 $result = new WP_Post( $result );1184 if ( $result ) 1185 $result = get_post( $result ); 1186 1186 1187 1187 return $result; 1188 1188 } … … 2057 2057 else 2058 2058 $url = WP_PLUGIN_URL; 2059 2059 2060 2060 2061 2061 $url = set_url_scheme( $url ); 2062 2062 2063 2063 if ( !empty($plugin) && is_string($plugin) ) {
