diff --git src/wp-includes/bookmark.php src/wp-includes/bookmark.php
index 1e178f4..69eaa15 100644
|
|
function get_bookmarks( $args = '' ) { |
128 | 128 | $r = wp_parse_args( $args, $defaults ); |
129 | 129 | |
130 | 130 | $key = md5( serialize( $r ) ); |
131 | | if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { |
| 131 | if ( 'rand' == $orderby ) { |
| 132 | if ( $results = wp_cache_get( $key, 'get_bookmarks_rand' ) ) { |
| 133 | return apply_filters( 'get_bookmarks', $results, $r ); |
| 134 | } |
| 135 | } elseif ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) { |
132 | 136 | if ( is_array( $cache ) && isset( $cache[ $key ] ) ) { |
133 | 137 | $bookmarks = $cache[ $key ]; |
134 | 138 | /** |
… |
… |
function get_bookmarks( $args = '' ) { |
285 | 289 | |
286 | 290 | $results = $wpdb->get_results( $query ); |
287 | 291 | |
288 | | $cache[ $key ] = $results; |
289 | | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
| 292 | if ( 'rand()' == $orderby ) { |
| 293 | /** |
| 294 | * Filter the expiration time of bookmarks when randomly ordered. |
| 295 | * |
| 296 | * @since 4.4.0 |
| 297 | * |
| 298 | * @param $rand_ttl Expiration time, in seconds. Default 60. |
| 299 | */ |
| 300 | $rand_ttl = apply_filters( 'get_bookmarks_rand_ttl', MINUTE_IN_SECONDS ); |
| 301 | wp_cache_set( $key, $results, 'get_bookmarks_rand', $rand_ttl ); |
| 302 | } else { |
| 303 | $cache[ $key ] = $results; |
| 304 | wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); |
| 305 | } |
290 | 306 | |
291 | 307 | /** This filter is documented in wp-includes/bookmark.php */ |
292 | 308 | return apply_filters( 'get_bookmarks', $results, $r ); |