WordPress.org

Forums

Simple Local Avatars
Fix for image upload... (2 posts)

  1. dancowper
    Member
    Posted 2 years ago #

    Ok, since the topics ( http://wordpress.org/support/topic/custom-edit-profile-page?replies=19 ) and ( http://wordpress.org/support/topic/plugin-user-photo-front-end-upload ) I needed to fix the uploading image for my custom template... I used "jimzqui's" code and then needed to tweak a few things...

    I added the following functions into the template directly within the logic that processes the form after "do_action('personal_options_update')".

    function edit_user_profile_update( $user_id ) {... }

    function avatar_delete( $user_id ) {... }

    I added the

    I couldn't get the nonce thing to work so I changed this line (this will be a security issue)...

    if ( !isset( $_POST[ '_simple_local_avatar_nonce' ] ) || !wp_verify_nonce( $_POST[ '_simple_local_avatar_nonce' ], 'simple_local_avatar_nonce' ) ) { //security

    to this

    if ( !isset( $_POST[ '_simple_local_avatar_nonce' ] ) ){ //security

    In the form I put this code...

    <tr>
    <th><?php echo get_avatar(intval($user_ID));?>

    <label for="simple-local-avatar"><?php _e('Photo','cp') ?></label></th>
    <td><input type="file" name="simple-local-avatar" id="simple-local-avatar" /></td>
    </tr>

    Ok well it worked... good luck!

    http://wordpress.org/extend/plugins/simple-local-avatars/

  2. joacomartel
    Member
    Posted 2 years ago #

    You can share the complete PHP's ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Local Avatars
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic