Skip to:
Content

BuddyPress.org

Changeset 5775


Ignore:
Timestamp:
02/13/2012 04:09:18 PM (13 years ago)
Author:
boonebgorges
Message:

Unhooks and rehooks WP's maybe_add_existing_user_to_blog() so that we can initialize the BP Blogs component before WP attemps to add users in this way. See #3916.

File:
1 edited

Legend:

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

    r5729 r5775  
    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;
Note: See TracChangeset for help on using the changeset viewer.