Skip to:
Content

BuddyPress.org

Changeset 11722


Ignore:
Timestamp:
11/02/2017 03:06:03 AM (9 years ago)
Author:
boonebgorges
Message:

Update blog cache clearing to be compatible with WP 4.9+.

Merges [11720] and [11721] to the 2.9 branch.

Fixes #7617.

Location:
branches/2.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9

  • branches/2.9/src/bp-blogs/bp-blogs-functions.php

    r11447 r11722  
    549549 * Deletes the 'url' blogmeta for a site.
    550550 *
    551  * Hooked to 'refresh_blog_details', which is notably used when editing a site
    552  * under "Network Admin > Sites".
     551 * Fires when a site's details are updated, which generally happens when
     552 * editing a site under "Network Admin > Sites". Prior to WP 4.9, the
     553 * correct hook was 'refresh_blog_details'; afterward, 'clean_site_cache'.
    553554 *
    554555 * @since 2.3.0
     
    559560        bp_blogs_delete_blogmeta( (int) $site_id, 'url' );
    560561}
    561 add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
     562
     563if ( function_exists( 'wp_switch_roles_and_user' ) ) {
     564        add_action( 'clean_site_cache', 'bp_blogs_delete_url_blogmeta' );
     565} else {
     566        add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
     567}
    562568
    563569/**
Note: See TracChangeset for help on using the changeset viewer.