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/functions.php

    r12605 r12606  
    286286                if ( ! is_multisite() ) {
    287287                        $this->markTestSkipped();
    288                 }
    289 
    290                 if ( function_exists( 'wp_initialize_site' ) ) {
    291                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    292288                }
    293289
     
    891887        public function test_bp_blogs_comment_sync_activity_comment_for_custom_post_type() {
    892888                if ( is_multisite() ) {
    893                         if ( function_exists( 'wp_initialize_site' ) ) {
    894                                 $this->setExpectedDeprecated( 'wpmu_new_blog' );
    895                         }
    896 
    897889                        $b = self::factory()->blog->create();
    898890                        switch_to_blog( $b );
     
    1001993                }
    1002994
    1003                 if ( function_exists( 'wp_initialize_site' ) ) {
    1004                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1005                 }
    1006 
    1007995                $old_user = get_current_user_id();
    1008996
     
    10351023                if ( ! is_multisite() ) {
    10361024                        $this->markTestSkipped();
    1037                 }
    1038 
    1039                 if ( function_exists( 'wp_initialize_site' ) ) {
    1040                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1041                         $this->setExpectedDeprecated( 'delete_blog' );
    10421025                }
    10431026
     
    10891072                }
    10901073
    1091                 if ( function_exists( 'wp_initialize_site' ) ) {
    1092                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1093                 }
    1094 
    10951074                $reset_post = $_POST;
    10961075                $old_user = get_current_user_id();
     
    11511130                }
    11521131
    1153                 if ( function_exists( 'wp_initialize_site' ) ) {
    1154                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1155                 }
    1156 
    11571132                $u1 = self::factory()->user->create();
    11581133                $b1 = get_current_blog_id();
     
    11811156                }
    11821157
    1183                 if ( function_exists( 'wp_initialize_site' ) ) {
    1184                         $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1185                 }
    1186 
    11871158                $u1 = self::factory()->user->create();
    11881159                $b1 = get_current_blog_id();
Note: See TracChangeset for help on using the changeset viewer.