• Resolved emangham

    (@emangham)


    Hey,

    Is it possible to get ONLY the URL of a user via $id?

    For example:

    
    function get_team_avatar_url( $id ) {
    	return get_wp_user_avatar_url( $id );
    }
    

    Thank you

Viewing 1 replies (of 1 total)
  • Matthew

    (@theclassicalmatt)

    Not sure if this is what you were looking for or if you’ve already found out but I’ll leave it here anyway.

    I’ve used this: get_wp_user_avatar_src
    I see you are using _url but _src is the one you need.

    function get_team_avatar_url( $id )
    {
    	// Just in case wp_user_avatar is disabled, check if exists.
    	return function_exists(get_wp_user_avatar_src) ? get_wp_user_avatar_src($id) : get_avatar_url($id);
    }

    Ver.1.9.13 – Since ver: 1.8 – /wp-user-avatar/includes/wpua-functions.php – Line:48

    function get_wp_user_avatar_src($id_or_email="", $size="", $align="") {
      global $wpua_functions;
      return $wpua_functions->get_wp_user_avatar_src($id_or_email, $size, $align);
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Get URL only via get_wp_user_avatar_url’ is closed to new replies.