Ticket #18356: 18356.refresh.patch
File 18356.refresh.patch, 1.3 KB (added by , 11 years ago) |
---|
-
wp-includes/bookmark.php
126 126 'limit' => -1, 'category' => '', 127 127 'category_name' => '', 'hide_invisible' => 1, 128 128 'show_updated' => 0, 'include' => '', 129 'exclude' => '', 'search' => '' 129 'exclude' => '', 'search' => '', 130 'expire' => 60 130 131 ); 131 132 132 133 $r = wp_parse_args( $args, $defaults ); … … 134 135 135 136 $cache = array(); 136 137 $key = md5( serialize( $r ) ); 137 if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { 138 if ( 'rand' == $orderby ) { 139 if ( $results = wp_cache_get( $key, 'get_bookmarks_rand' ) ) 140 return apply_filters( 'get_bookmarks', $results, $r ); 141 } elseif ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { 138 142 if ( is_array($cache) && isset( $cache[ $key ] ) ) 139 143 return apply_filters('get_bookmarks', $cache[ $key ], $r ); 140 144 } … … 260 264 261 265 $results = $wpdb->get_results($query); 262 266 263 $cache[ $key ] = $results; 264 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 267 if ( 'rand()' == $orderby ) { 268 wp_cache_set( $key, $results, 'get_bookmarks_rand', $expire ); 269 } else { 270 $cache[$key] = $results; 271 wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); 272 } 265 273 266 274 return apply_filters('get_bookmarks', $results, $r); 267 275 }