Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2020 02:45:13 AM (6 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/tests/phpunit/testcases/blogs/activity.php

    r12395 r12606  
    3434                }
    3535
    36                 if ( function_exists( 'wp_initialize_site' ) ) {
    37                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    38                 }
    39 
    4036                $b = self::factory()->blog->create();
    4137                $u = self::factory()->user->create();
     
    131127                }
    132128
    133                 if ( function_exists( 'wp_initialize_site' ) ) {
    134                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    135                 }
    136 
    137129                $b = self::factory()->blog->create();
    138130                $u = self::factory()->user->create();
     
    176168                }
    177169
    178                 if ( function_exists( 'wp_initialize_site' ) ) {
    179                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    180                 }
    181 
    182170                $b = self::factory()->blog->create();
    183171                $u = self::factory()->user->create();
     
    223211                }
    224212
    225                 if ( function_exists( 'wp_initialize_site' ) ) {
    226                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    227                 }
    228 
    229213                add_filter( 'bp_blogs_activity_created_blog_action', array( $this, 'created_blog_passthrough' ), 10, 2 );
    230214
     
    255239                }
    256240
    257                 if ( function_exists( 'wp_initialize_site' ) ) {
    258                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    259                 }
    260 
    261241                add_filter( 'bp_blogs_activity_new_post_action', array( $this, 'new_post_passthrough' ), 10, 2 );
    262242
     
    287267                }
    288268
    289                 if ( function_exists( 'wp_initialize_site' ) ) {
    290                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    291                 }
    292 
    293269                add_filter( 'bp_blogs_activity_new_comment_action', array( $this, 'new_comment_passthrough' ), 10, 2 );
    294270
     
    322298                if ( ! is_multisite() ) {
    323299                        $this->markTestSkipped();
    324                 }
    325 
    326                 if ( function_exists( 'wp_initialize_site' ) ) {
    327                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    328300                }
    329301
Note: See TracChangeset for help on using the changeset viewer.