Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem displaying user avatar


  • Florent
    Participant

    @frappi

    Hello,

    I use this function to display the user avatar but for some reason the image is not displayed.

    function author_avatar_shortocode_handler($atts) {
    	
    	return "<img src='". bp_core_fetch_avatar ( array( 'item_id' => $atts, 'type' => 'full' ) ). "' >";
    }

    Firebug show that image URL starts with // as in :

    src='<img src="//www.gravatar.com/avatar/cfb543ca40e1d2c06d297f83bac37bfd?s=150&r=g&d=monsterid" class="avatar user-Array-avatar avatar-150 photo" width="150" height="150" alt="Photo du profil" />'

    Do you have an idea how to remove this ?

    Thank you,

Viewing 1 replies (of 1 total)

  • Florent
    Participant

    @frappi

    Topic close as result is already formated :
    http://hookr.io/functions/bp_core_fetch_avatar/

    Usage

    $string = bp_core_fetch_avatar( $args );

    Parameters

    $args
    ( array|string ) optional – { An array of arguments. All arguments are technically optional; some will, if not provided, be auto-detected by bp_core_fetch_avatar(). This auto-detection is described more below, when discussing specific arguments.

    Returns

    string Formatted HTML element, or raw avatar URL based on $html arg.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem displaying user avatar’ is closed to new replies.
Skip to toolbar