[buddypress-trac] [BuddyPress] #4333: Allow User avatar functions to pass through arguments to bp_core_fetch_avatar

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Jul 6 18:02:33 UTC 2012


#4333: Allow User avatar functions to pass through arguments to
bp_core_fetch_avatar
--------------------------+-------------------------------------
 Reporter:  cklosows      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Members       |    Version:  1.6-beta
 Severity:  normal        |   Keywords:  has-patch needs-testing
--------------------------+-------------------------------------
 If an argument is passed to bp_loggedin_user_avatar that is accepted by
 bp_core_fetch_avatar, it is not passed through to bp_core_fetch_avatar.

 bp_get_loggedin_user_avatar and bp_get_displayed_user_avatar accepts the
 following arguments:
                 'type'   => 'thumb',
                 'width'  => false,
                 'height' => false,
                 'html'   => true,
                 'alt'    => __( 'Profile picture of %s', 'buddypress' )

 bp_core_fetch_avatar accepts the following arguments:
                 'item_id'    => false,
                 'object'     => $def_object, // user/group/blog/custom
 type (if you use filters)
                 'type'       => $def_type,   // thumb or full
                 'avatar_dir' => false,       // Specify a custom avatar
 directory for your object
                 'width'      => false,       // Custom width (int)
                 'height'     => false,       // Custom height (int)
                 'class'      => $def_class,  // Custom <img> class
 (string)
                 'css_id'     => false,       // Custom <img> ID (string)
                 'alt'        => $def_alt,    // Custom <img> alt (string)
                 'email'      => false,       // Pass the user email (for
 gravatar) to prevent querying the DB for it
                 'no_grav'    => false,       // If there is no avatar
 found, return false instead of a grav?
                 'html'       => true,        // Wrap the return img URL in
 <img />
                 'title'      => ''           // Custom <img> title
 (string)

 If I were to send 'no_grav' => true as an argument for
 bp_loggedin_user_avatar it would not send this to bp_core_fetch_avatar due
 to hard coded values in the 'bp_get_loggedin_user_avatar' filter call.

 I think we should send any arguments through to bp_core_fetch_avatar that
 are supplied to bp_loggedin_user_avatar, while keeping the defaults for
 bp_loggedin_user_avatar in place.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4333>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list