| 3606 | |
| 3607 | if ( $q['cache_results'] ) { |
| 3608 | $key = md5( $this->request ); |
| 3609 | $last_changed = wp_cache_get( 'last_changed', 'posts' ); |
| 3610 | if ( ! $last_changed ) { |
| 3611 | $last_changed = microtime(); |
| 3612 | wp_cache_set( 'last_changed', $last_changed, 'posts' ); |
| 3613 | } |
| 3614 | $cache_key = "get_post_ids:$key:$last_changed"; |
| 3615 | $ids = wp_cache_get( $cache_key, 'posts' ); |
| 3616 | if ( false === $ids ) { |
| 3617 | $ids = $wpdb->get_col( $this->request ); |
| 3618 | wp_cache_add( $cache_key, $ids, 'posts' ); |
| 3619 | } |
| 3620 | } else { |
| 3621 | $ids = $wpdb->get_col( $this->request ); |
| 3622 | } |