Upload profile picture on Account Page?
-
Hi
Is there a way to add a upload user profile picture on their Account page [ultimate_member_account]?
If you suggest any, that would be great.
Regards,
Jam
-
Hi @dabert3
I’ve updated the Profile Photo uploader plugin in the link: https://docs.ultimatemember.com/article/1663-download-installation-of-the-basic-extensions
It now supports the Profile Photo uploader in Register and Account forms. When you install the plugin, just add this piece of code to your theme/child-theme’s functions.php file or use the Code snippet plugin to run the code. It should display the Profile Photo uploader to the Account > General tab:
function um_011921_add_profile_photo_uploader( $args, $shortcode_args ) { $args = 'register_profile_photo,' . $args; return $args; }
Regards,
Hello @champsupertramp
Thanks for this. I follow the instruction and installed um-profile-photo plugin extension successfully. I added the code in functions.php but as I check the settings, there’s no option in it. There’s no field as well in account page http://prntscr.com/26fxc8o. What could be the issue here?
As you posted the code, is it filter/action hook? or just a function?
If you have screenshot where to find that, much appreciated.
PS. I used [ultimatemember_account] to display the account details, not [ultimate_member_account].
Regards,
Hi @dabert3
First, you need to add the Profile Photo field to any forms in the UM Form Builder:
https://drive.google.com/file/d/19aDNr5KUY641UzAbRpOm1IPoaOmdVsCm/view?usp=sharingOnce it is added, you can then remove it. We just need to record that Profile Photo field as one of the used fields so that it will display in the Account form with the code above.
Regards,
Hello @champsupertramp
Here’s what I did https://www.loom.com/share/eec4d7e4823f4618a23fa9e2168fef36. Also the code you mentioned is still here http://prntscr.com/26idsot
Please check the video and let me know what did I do wrong.Best Regards,
HI @dabert3
Sorry, the code I’ve provided above is incomplete. Here’s the full code:
add_filter( 'um_account_tab_general_fields', 'um_011921_add_profile_photo_uploader', 10, 2 ); function um_011921_add_profile_photo_uploader( $args, $shortcode_args ) { $args = 'register_profile_photo,' . $args; return $args; }
Regards,
Yeah I noticed that, thats why I asked in the first place if it just a function or this is a hook/filter hehe. But it works now.
I have last question. I noticed that when uploading the image, it will automatic reload the page and it needs also to purge/clear cache just to show the updated image. So, what hook run when uploading the image? I try this hook um_submit_account_details and would like to add litespeed_purge_post hook inside of it but it seems its not working (please check image) http://prntscr.com/26it5iw
PS. 816 is the ID of profile page. I tried litespeed_purge_post on the other hook and works fine except uploading/updating the profile image.
Best Regards,
Hi @dabert3
I would use the following action hook that’s triggered after updating the account.
add_action("um_after_user_account_updated","um_012522_account_updated"); function um_012522_account_updated( $user_id ){ // do something }
Regards,
Hello @champsupertramp
It works! This is what I need! Problem solved. Thank you for your big help, your the best! Very much appreciated.
Best Regards,
Thanks for letting us know.
Regards,
- The topic ‘Upload profile picture on Account Page?’ is closed to new replies.