526 | | if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) |
527 | | $global_groups = $wp_object_cache->global_groups; |
528 | | else |
529 | | $global_groups = false; |
530 | | |
531 | | wp_cache_init(); |
532 | | |
533 | | if ( function_exists( 'wp_cache_add_global_groups' ) ) { |
534 | | if ( is_array( $global_groups ) ) |
535 | | wp_cache_add_global_groups( $global_groups ); |
536 | | else |
537 | | wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', ' blog-id-cache' ) ); |
538 | | wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); |
539 | | } |
540 | | } |
541 | | |
587 | | if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) |
588 | | $global_groups = $wp_object_cache->global_groups; |
589 | | else |
590 | | $global_groups = false; |
591 | | |
592 | | wp_cache_init(); |
593 | | |
594 | | if ( function_exists( 'wp_cache_add_global_groups' ) ) { |
595 | | if ( is_array( $global_groups ) ) |
596 | | wp_cache_add_global_groups( $global_groups ); |
597 | | else |
598 | | wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', ' blog-id-cache' ) ); |
599 | | wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); |
600 | | } |
601 | | } |
602 | | |
| 597 | * Cache reset process used when switch_to_blog() and restore_current_blog() are called. |
| 598 | * Necessary only when persistent object cache doesn't have a wp_cache_switch_to_blog() function. |
| 599 | * |
| 600 | * @since 3.6.0 |
| 601 | * |
| 602 | * @global $wp_object_cache |
| 603 | * |
| 604 | * @uses _wp_cache_get_all_nonpersistent_groups |
| 605 | * @uses wp_cache_init |
| 606 | * @uses wp_cache_add_global_groups |
| 607 | * @uses wp_cache_add_nonpersistent_groups |
| 608 | * @return null |
| 609 | */ |
| 610 | function _ms_cache_switch_fallback() { |
| 611 | global $wp_object_cache; |
| 612 | |
| 613 | if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) |
| 614 | $global_groups = $wp_object_cache->global_groups; |
| 615 | else |
| 616 | $global_groups = false; |
| 617 | |
| 618 | if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'get_non_persistent_groups' ) ) |
| 619 | $non_persistent_groups = $wp_object_cache->get_non_persistent_groups(); |
| 620 | else |
| 621 | $non_persistent_groups = false; |
| 622 | |
| 623 | wp_cache_init(); |
| 624 | |
| 625 | if ( function_exists( 'wp_cache_add_global_groups' ) ) { |
| 626 | if ( is_array( $global_groups ) ) |
| 627 | wp_cache_add_global_groups( $global_groups ); |
| 628 | else |
| 629 | wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', ' blog-id-cache' ) ); |
| 630 | } |
| 631 | |
| 632 | if ( function_exists( 'wp_cache_add_non_persistent_groups' ) ) { |
| 633 | if ( is_array( $non_persistent_groups ) ) |
| 634 | wp_cache_add_non_persistent_groups( $non_persistent_groups ); |
| 635 | else |
| 636 | wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | /** |