Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:14:31 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Use bp_displayed_user_id() rather than reference the $bp->displayed_user->id global var directly. First step at consolidating user ID checks to use WP_User class later. See #3738.

File:
1 edited

Legend:

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

    r4819 r5301  
    1515                global $bp, $wpdb;
    1616
    17                 $user_id = $bp->displayed_user->id;
     17                $user_id = bp_displayed_user_id();
    1818
    1919                if ( $id ) {
    … …  
    151151
    152152                if ( !$user_id )
    153                         $user_id = $bp->displayed_user->id;
     153                        $user_id = bp_displayed_user_id();
    154154
    155155                // Show logged in users their hidden blogs.
    … …  
    177177
    178178                if ( !$user_id )
    179                         $user_id = $bp->displayed_user->id;
     179                        $user_id = bp_displayed_user_id();
    180180
    181181                return $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
    … …  
    192192
    193193                if ( !$user_id )
    194                         $user_id = $bp->displayed_user->id;
     194                        $user_id = bp_displayed_user_id();
    195195
    196196                // If the user is logged in return the blog count including their hidden blogs.
Note: See TracChangeset for help on using the changeset viewer.