User Avatar Change not working perfectly
-
https://prnt.sc/s470md
https://prnt.sc/s471y3
i use custom form to change user profile
here is the code
<form method=”post” id=”adduser” action=”<?php the_permalink(); ?>”>
<?php
//action hook for plugin and extra fields
do_action(‘edit_user_profile’,get_current_user_id());
?>
<div class=”form-fields”>
<p class=”form-username”>
<input placeholder=”<?php _e(‘First Name’, ‘profile’); ?>” class=”text-input” name=”first-name” type=”text” id=”first-name” value=”<?php the_author_meta( ‘first_name’, get_current_user_id() ); ?>” />
</p><!– .form-username –>
<p class=”form-username”>
<input placeholder=”<?php _e(‘Last Name’, ‘profile’); ?>” class=”text-input” name=”last-name” type=”text” id=”last-name” value=”<?php the_author_meta( ‘last_name’, get_current_user_id() ); ?>” />
</p><!– .form-username –>
<p class=”form-email”>
<input placeholder=”<?php _e(‘E-mail *’, ‘profile’); ?>” class=”text-input” name=”email” type=”text” id=”email” value=”<?php the_author_meta( ‘user_email’, get_current_user_id() ); ?>” />
</p><!– .form-email –>
<p class=”form-phone”>
<input placeholder=”<?php _e(‘Phone Number’, ‘profile’); ?>” class=”text-input” name=”phone_number” type=”tel” id=”phone_number” value=”<?php the_author_meta( ‘phone_number’, get_current_user_id() ); ?>” />
</p>
<p class=”form-password”>
<input placeholder=”<?php _e(‘Password *’, ‘profile’); ?>” class=”text-input” name=”pass1″ type=”password” id=”pass1″ />
</p><!– .form-password –>
<p class=”form-password”>
<input placeholder=”<?php _e(‘Repeat Password *’, ‘profile’); ?>” class=”text-input” name=”pass2″ type=”password” id=”pass2″ />
</p><!– .form-password –>
</div><div class=”form-submit” style=”text-align: center”>
<input name=”updateuser” type=”submit” id=”updateuser” class=”submit button” value=”<?php _e(‘Update’, ‘profile’); ?>” />
<?php wp_nonce_field( ‘update-user’ ) ?>
<input name=”action” type=”hidden” id=”action” value=”update-user” />
</div><!– .form-submit –>
</form>issues:
1) admin can upload avatar from the media library , but it is not showing correctly , but the default avatar is showing
2) although i enabled the setting for subscribers can upload avatar , avatar uploading from front end does not working for subscribers and other user roles also
please help me if you have some experience in it
- The topic ‘User Avatar Change not working perfectly’ is closed to new replies.