Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/14/2011 02:42:23 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Correctly check for WP_Error and correctly load anonymous user cookie data/avatar. Fixes #1452. Props GautamGupta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-user-template.php

    r2758 r2803  
    405405     * @param int $size Size of the avatar. Defaults to 40
    406406     * @uses bbp_get_current_user_id() To get the current user id
     407     * @uses bbp_get_current_anonymous_user_data() To get the current
     408     *                                              anonymous user's email
    407409     * @uses get_avatar() To get the avatar
    408410     * @uses apply_filters() Calls 'bbp_get_current_user_avatar' with the
     
    411413     */
    412414    function bbp_get_current_user_avatar( $size = 40 ) {
    413         return apply_filters( 'bbp_get_current_user_avatar', get_avatar( bbp_get_current_user_id(), $size ), $size );
     415
     416        if ( !$user = bbp_get_current_user_id() )
     417            $user = bbp_get_current_anonymous_user_data( 'email' );
     418
     419        return apply_filters( 'bbp_get_current_user_avatar', get_avatar( $user, $size ), $size );
    414420    }
    415421
Note: See TracChangeset for help on using the changeset viewer.