Skip to:
Content

BuddyPress.org

Changeset 2759


Ignore:
Timestamp:
02/22/2010 01:08:24 PM (15 years ago)
Author:
apeatling
Message:

Fixing bug with recording when a user is added to a blog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-blogs.php

    r2755 r2759  
    551551add_action( 'wp_set_comment_status', 'bp_blogs_manage_comment', 10, 2 );
    552552
    553 function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id ) {
    554     if ( $role != 'subscriber' ) {
     553function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id = false ) {
     554    global $current_blog;
     555
     556    if ( empty( $blog_id ) )
     557        $blog_id = $current_blog->blog_id;
     558
     559    if ( $role != 'subscriber' )
    555560        bp_blogs_record_blog( $blog_id, $user_id, true );
    556     }
    557561}
    558562add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
    559563
    560 function bp_blogs_remove_user_from_blog( $user_id, $blog_id ) {
     564function bp_blogs_remove_user_from_blog( $user_id, $blog_id = false ) {
     565    global $current_blog;
     566
     567    if ( empty( $blog_id ) )
     568        $blog_id = $current_blog->blog_id;
     569
    561570    bp_blogs_remove_blog_for_user( $user_id, $blog_id );
    562571}
Note: See TracChangeset for help on using the changeset viewer.