There is a wordpress website with the Theme My Login plugin installed. I want to make it possible for the user to register to add and save the user's avatar. With the addition of the question decided so:

 <h3>Загрузка аватарки</h3> <?php echo get_simple_local_avatar( $profileuser->ID ); ?> <?php if ( ! $upload_rights = current_user_can('upload_files') ) $upload_rights = empty( $this->options['caps'] ); if ( $upload_rights ) { do_action( 'simple_local_avatar_notices' ); wp_nonce_field( 'simple_local_avatar_nonce', '_simple_local_avatar_nonce', false ); ?> <p> <input type="file" name="simple-local-avatar" id="upload_hidden" onchange="document.getElementById('upload_visible').value = this.value;" /> <button type="button" id="review" onclick="document.getElementById('upload_hidden').click();">Выбрать</button> </p> <p> <?php if ( current_user_can( 'upload_files' ) && did_action( 'wp_enqueue_media' ) ) : ?><a href="#" class="button hide-if-no-js" id="simple-local-avatar-media"><?php _e( 'Choose from Media Library', 'simple-local-avatars' ); ?></a> &nbsp;<?php endif; ?> </p> <?php } else { if ( empty( $profileuser->simple_local_avatar ) ) echo '<span class="description">' . __('No local avatar is set. Set up your avatar at Gravatar.com.','simple-local-avatars') . '</span>'; else echo '<span class="description">' . __('You do not have media management permissions. To change your local avatar, contact the blog administrator.','simple-local-avatars') . '</span>'; } ?> 

And how to save it now? here it is indicated how to add and register additional fields, but for the avatar, the approach is different

  • one
    at one time solved this problem by storing the image in the created add. User profile field - alenkins
  • @alenkins can be more? - Vasya

0