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 ) { |
341 | 341 | } |
342 | 342 | add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 ); |
343 | 343 | |
| 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 | */ |
| 353 | function 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 | } |
| 357 | add_action( 'init', 'bp_blogs_maybe_add_user_to_blog', 1 ); |
| 358 | |
344 | 359 | function bp_blogs_remove_blog( $blog_id ) { |
345 | 360 | global $bp; |
346 | 361 | |