I created user pages. Successfully brought a change of name, mail, passwords. I would also like to add avatar changes, but just pulling the code from the plugin does not work 🙁
Hi @mrvigner,
Editing the user avatar on the front end is not the scope of this plugin. To edit the avatar on the front end, you need to build a media uploader to upload the avatar and save the avatar data back to the database after users hit the save button. There are plenty of tutorials out there on using media uploader on the front end. Hope this helps!
@dinhtungdu can you give examples links? I’m trying to find but no sucess.
I’m interested in doing it also, but without MEDIA UPLOADER and simple local upload field input… is it possible?
Right now I can display the avatar in frontend using:
do_action(‘show_user_profile’);
do_action(‘edit_user_profile’);
But the upload function is not displayed.
@dinhtungdu yeah right. But those are solutions to upload with media only. Thank you.
But I need to upload through normal upload file. Not media…
@dinhtungdu any update on this feature?
@biqu3 with this PR merged: https://github.com/10up/simple-local-avatars/pull/48, you can programmatically set new avatar, again you have to create the media/file uploader yourselves. We’re preparing a new release that includes that fix, it hasn’t deployed to wordpress.org yet, but you can download the latest development version from GitHub to test.
You can use a simple form with file
field to upload file, for example: https://www.w3schools.com/php/php_file_upload.asp.