Feature #8639
closedAdd photo upload to registration page
0%
Description
See https://chris0stein.github.io/commons-ux/registration/index.html
Currently, avatar uploads take place after the first page of registration is complete. We'd like to move it inline.
Dan, can I ask you to have an initial look? There'll be two tricky bits:
1. Putting the avatar upload UI on this page. Check out the avatar upload tool built into BP (see https://commons.gc.cuny.edu/members/[username]/profile/change-avatar/). I think that it should be fairly portable - you just need to figure out what to enqueue, etc.
2. Figure out a way to store the avatar and associate it with a user. BP avatars are stored in wp-content/blogs.dir/1/files/avatars, in directories keyed by user IDs. (Use wp_upload_dir() to get the base path.) When a user registers, however, there is no user ID yet. BuddyPress used to do this by (a) using a hash of the signup key for temporary storage https://buddypress.trac.wordpress.org/browser/tags/1.2.7/bp-core/bp-core-signup.php?marks=171#L165, and then moving the file at the time of activation (when the user account is created) https://buddypress.trac.wordpress.org/browser/tags/1.2.7/bp-core/bp-core-signup.php?marks=228,233-234#L206. Something like this seems like a workable technique.
If it's not too much trouble, let's put as much of the logic as we can into a separate plugin, in case we want to release it.
Let me know if you need more pointers!
Files
Related issues