• I swear I saw this function before, but now I can’t find it. I need a PHP function to return the URL (or even better, the “$attachment_id”) of the user profile photo.

    I have a simple form for the users to create a new post, and I want the new post to automatically have the thumbnail set to be the same as the user image. I plan to accomplish this with the set_post_thumbnail function hooked into the post creation, but before I do any of that, I need the file information.

    Thanks for the help!

Viewing 1 replies (of 1 total)
  • Hi I’ve just found these functions in /core/um-short-functions.php:
    —————————–
    um_get_user_avatar_url()
    um_get_default_avatar_uri()
    um_get_avatar_uri()
    um_get_avatar_url();
    —————————–
    // link: https://gist.github.com/champsupertramp/45cc47f4d5fe67cf739b
    global $ultimatemember;
    $ultimatemember->user->set( get_the_author_meta( ‘ID’ ) );
    um_get_avatar_uri( um_profile( ‘profile_photo’ ), 25 );
    —————————–
    // LE: found the function to set the user, which does the same thing as above
    um_fetch_user( get_the_author_meta( ‘ID’ ) );
    um_get_avatar_uri( um_profile( ‘profile_photo’ ), 25 );

    • This reply was modified 7 years, 2 months ago by tamas_web.
Viewing 1 replies (of 1 total)
  • The topic ‘How to call the user profile picture URL or $attachment_id?’ is closed to new replies.