Skip to:
Content

BuddyPress.org

Changeset 371 for trunk/bp-blogs.php


Ignore:
Timestamp:
10/02/2008 05:47:14 AM (18 years ago)
Author:
apeatling
Message:

Fixed missing user ID on blog post deletion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r365 r371  
    250250        global $bp;
    251251       
     252        if ( !$bp ) {
     253                bp_core_setup_globals();
     254                bp_blogs_setup_globals();
     255        }
     256       
    252257        if ( !$user_id )
    253258                $user_id = $bp['loggedin_userid'];
    … …  
    270275function bp_blogs_record_post($post_id = '') {
    271276        global $bp, $current_blog;
     277       
     278        if ( !$bp ) {
     279                bp_core_setup_globals();
     280                bp_blogs_setup_globals();
     281        }
    272282       
    273283        $post_id = (int)$post_id;
    … …  
    398408
    399409function bp_blogs_remove_post( $post_id = '' ) {
    400         global $current_blog;
     410        global $current_blog, $bp;
     411       
     412        if ( !$bp ) {
     413                bp_core_setup_globals();
     414                bp_blogs_setup_globals();
     415        }
    401416       
    402417        $post_id = (int)$post_id;
    403418        $blog_id = (int)$current_blog->blog_id;
    404419
    405         BP_Blogs_Post::delete( $post_id, $blog_id );
     420        BP_Blogs_Post::delete( $post_id, $blog_id, $bp['loggedin_userid'] );
    406421}
    407422add_action( 'delete_post', 'bp_blogs_remove_post' );
    408423
    409424function bp_blogs_remove_comment( $comment_id = '' ) {
    410         global $current_blog;
     425        global $current_blog, $bp;
     426       
     427        if ( !$bp ) {
     428                bp_core_setup_globals();
     429                bp_blogs_setup_globals();
     430        }
    411431       
    412432        $comment_id = (int)$comment_id;
    413433        $blog_id = (int)$current_blog->blog_id;
    414434       
    415         BP_Blogs_Comment::delete( $comment_id, $blog_id );     
     435        BP_Blogs_Comment::delete( $comment_id, $blog_id, $bp['loggedin_userid'] );     
    416436}
    417437add_action( 'delete_comment', 'bp_blogs_remove_comment' );
    … …  
    437457        global $wpdb, $bp;
    438458       
     459        if ( !$bp ) {
     460                bp_core_setup_globals();
     461                bp_blogs_setup_globals();
     462        }       
     463       
    439464        $user_id = $bp['loggedin_userid'];
    440465        $blogs = get_blogs_of_user($user_id);
Note: See TracChangeset for help on using the changeset viewer.