IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
2925 | 2925 | |
2926 | 2926 | clean_post_cache( $post_ID ); |
2927 | 2927 | |
| 2928 | if ( function_exists( 'wp_cache_incr' ) ) { |
| 2929 | wp_cache_incr( 'last_changed', 1, 'posts' ); |
| 2930 | } else { |
| 2931 | $last_changed = wp_cache_get( 'last_changed', 'posts' ); |
| 2932 | wp_cache_set( 'last_changed', $last_changed + 1, 'posts' ); |
| 2933 | } |
| 2934 | |
2928 | 2935 | $post = get_post($post_ID); |
2929 | 2936 | |
2930 | 2937 | if ( !empty($page_template) && 'page' == $data['post_type'] ) { |
… |
… |
|
3649 | 3656 | if ( array_diff( $post_status, get_post_stati() ) ) |
3650 | 3657 | return $pages; |
3651 | 3658 | |
3652 | | $cache = array(); |
| 3659 | // $args can be whatever, only use the args defined in defaults to compute the key |
3653 | 3660 | $key = md5( serialize( compact(array_keys($defaults)) ) ); |
3654 | | if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) { |
3655 | | if ( is_array($cache) && isset( $cache[ $key ] ) && is_array( $cache[ $key ] ) ) { |
3656 | | // Convert to WP_Post instances |
3657 | | $pages = array_map( 'get_post', $cache[ $key ] ); |
3658 | | $pages = apply_filters( 'get_pages', $pages, $r ); |
3659 | | return $pages; |
3660 | | } |
3661 | | } |
| 3661 | $last_changed = wp_cache_get( 'last_changed', 'posts' ); |
| 3662 | if ( ! $last_changed ) |
| 3663 | $last_changed = wp_cache_set( 'last_changed', 1, 'posts' ); |
| 3664 | |
| 3665 | $cache_key = "get_pages:$key:$last_changed"; |
| 3666 | if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) { |
| 3667 | // Convert to WP_Post instances |
| 3668 | $pages = array_map( 'get_post', $cache ); |
| 3669 | $pages = apply_filters('get_pages', $pages, $r); |
| 3670 | return $pages; |
| 3671 | } |
3662 | 3672 | |
3663 | 3673 | if ( !is_array($cache) ) |
3664 | 3674 | $cache = array(); |
… |
… |
|
3827 | 3837 | } |
3828 | 3838 | } |
3829 | 3839 | |
3830 | | $cache[ $key ] = $pages; |
3831 | | wp_cache_set( 'get_pages', $cache, 'posts' ); |
| 3840 | $page_structure = array(); |
| 3841 | foreach ( $pages as $page ) |
| 3842 | $page_structure[] = $page->ID; |
3832 | 3843 | |
| 3844 | wp_cache_set( $cache_key, $page_structure, 'posts' ); |
| 3845 | |
3833 | 3846 | // Convert to WP_Post instances |
3834 | 3847 | $pages = array_map( 'get_post', $pages ); |
3835 | 3848 | |
… |
… |
|
4662 | 4675 | if ( 'page' == $post->post_type ) { |
4663 | 4676 | wp_cache_delete( 'all_page_ids', 'posts' ); |
4664 | 4677 | do_action( 'clean_page_cache', $post->ID ); |
| 4678 | } |
| 4679 | |
| 4680 | if ( function_exists( 'wp_cache_incr' ) ) { |
| 4681 | wp_cache_incr( 'last_changed', 1, 'posts' ); |
| 4682 | } else { |
| 4683 | $last_changed = wp_cache_get( 'last_changed', 'posts' ); |
| 4684 | wp_cache_set( 'last_changed', $last_changed + 1, 'posts' ); |
4665 | 4685 | } |
4666 | 4686 | } |
4667 | 4687 | |