I created extra fields for my subscribers, one of them is an image field, so they can upload an image to their profile.
I created the fields with ACF (Advanced Custom Fields).
I have a custom register form and a custom edit form, with the regular WordPress fields and the extra ones. Everything works perfectly... Except for the image field.
I'm not worried about the register form, I accept that the user won't upload the image when registering, but I need them to be able to edit/upload the image when editting their info.
Ps.(1):The image will be used as the avatar, I won't use the regular WordPress avatar.
Ps.(2):I won't use the acf_form() because I need to edit too much on how the form works.
Here is part of the code:
<label for="avatar_user"></label>
<input class="text-input" name="avatar_user" type="file" id="avatar_user" value="<?php the_author_meta( 'avatar_user', $current_user->ID ); ?>" />
if ( !empty( $_POST['avatar_user'] ) ) :
update_user_meta( $current_user->ID, 'avatar_user', esc_attr( $_POST['avatar_user'] ) );