Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2020 02:45:13 AM (4 years ago)
Author:
imath
Message:

Adapt BuddyPress to WP 5.1.0 multisite changes & deprecations

Version 5.1.0 of WordPress deprecated two hooks (wpmu_new_blog & delete_blog) BuddyPress is using to run some of the BP Blogs component's features. In order to preserve these features for the versions of WordPress we support and that are older than 5.1.0 as well as start using the replacement hooks introduced in 5.1.0 (wp_initialize_site & wp_validate_site_deletion), we are introducing a compatibility mechanism to make sure BuddyPress is using the right hooks depending on the installed WordPress it's activated on.

Props boonebgorges & I ;)

Fixes #7984

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r12605 r12606  
    412412    do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded, $no_activity ) );
    413413}
    414 add_action( 'wpmu_new_blog', 'bp_blogs_record_blog', 10, 2 );
     414add_action( 'bp_insert_site', 'bp_blogs_record_blog', 10, 2 );
    415415
    416416/**
     
    995995    do_action( 'bp_blogs_remove_blog', $blog_id );
    996996}
    997 add_action( 'delete_blog', 'bp_blogs_remove_blog' );
     997add_action( 'bp_delete_site', 'bp_blogs_remove_blog' );
    998998
    999999/**
     
    12191219    do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
    12201220}
    1221 add_action( 'delete_blog', 'bp_blogs_remove_data_for_blog', 1 );
     1221add_action( 'bp_delete_site', 'bp_blogs_remove_data_for_blog', 1 );
    12221222
    12231223/**
Note: See TracChangeset for help on using the changeset viewer.