Skip to:
Content

BuddyPress.org

Ticket #3916: 3916.01.patch

File 3916.01.patch, 1.0 KB (added by boonebgorges, 13 years ago)
  • bp-blogs/bp-blogs-functions.php

    diff --git bp-blogs/bp-blogs-functions.php bp-blogs/bp-blogs-functions.php
    index 562ea83..508bade 100644
    function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) { 
    341341}
    342342add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
    343343
     344/**
     345 * Rehooks WP's maybe_add_existing_user_to_blog with a later priority
     346 *
     347 * WordPress catches add-user-to-blog requests at init:10. In some cases, this can precede BP's
     348 * Blogs component. This function bumps the priority of the core function, so that we can be sure
     349 * that the Blogs component is loaded first. See http://buddypress.trac.wordpress.org/ticket/3916
     350 *
     351 * @since 1.6
     352 */
     353function bp_blogs_maybe_add_user_to_blog() {
     354        remove_action( 'init', 'maybe_add_existing_user_to_blog' );
     355        add_action( 'init', 'maybe_add_existing_user_to_blog', 20 );
     356}
     357add_action( 'init', 'bp_blogs_maybe_add_user_to_blog', 1 );
     358
    344359function bp_blogs_remove_blog( $blog_id ) {
    345360        global $bp;
    346361