How to Set Avatar Programmatically
-
I am trying to allow users to upload their avatar on the front-end of the site. Since this plugin does not have that built-in functionality, I’m going to have them upload an image and then I’d like some PHP code to assign it as their avatar afterwards.
Would this be the most appropriate code to use once the upload completes?
$avatar_id = **ID OF THE IMAGE FILE UPLOADED ELSEWHERE**; $sla = new Simple_Local_Avatars(); $sla->assign_new_user_avatar( (int) $avatar_id, $user->ID );
Will this work if the user already has an avatar? Thanks for any help!
– Aaron
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to Set Avatar Programmatically’ is closed to new replies.