WordPress.org

Ready to get started?Download WordPress

Forums

Simple Local Avatars
Avatar doesnt get saved in fornt end (8 posts)

  1. gixty7
    Member
    Posted 2 years ago #

    Hello,

    I am using profile builder plugin and simple-local-avatars so users can upload an avatar from the front end. However, the picture doesnt get saved when they update their profile.

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

  2. xaja
    Member
    Posted 2 years ago #

    same bug!

  3. Thandrol
    Member
    Posted 1 year ago #

    To fix this you need to copy the 'views' folder from the plugin to your theme. Then edit the settings.php file, line 41. Add id="your-profile" to the form.

    <form action="<?php echo feu_get_url('settings'); ?>" method="post" id="your-profile">

  4. nicolaelvin
    Member
    Posted 1 year ago #

    Do you know how to fix this when not using a plugin to show the profile? I am just using php to echo out the profile form and saving it.

  5. syarul
    Member
    Posted 1 year ago #

    you need to pass parameters to the plugin setup_actions to ensure simple-local-avatars can upload the file.

    1. action 'edit_user_profile' needs a WordPress user object which can be taken from WP_User class.
    2. action 'edit_user_profile_update' needs the user id.

  6. nicolaelvin
    Member
    Posted 1 year ago #

    ahh ok then. I am simply using the below which does display the avatar.

    <?php
    $myAv = new simple_local_avatars();
    $myAv->edit_user_profile($current_user);
    ?>

    But what isn't working is the uploading, I guess this is because I am not using the edit_user_profile_update() function. My form posts back to the same page, as the updates for all the other fielda are on the same page. So how do I update the avatar on pressing submit. What code do I need in my page? For the other fields I have for example:

    if ( !empty( $_POST['url'] ) )
            update_usermeta( $current_user->id, 'user_url', esc_url( $_POST['url'] ) );
  7. Florence
    Member
    Posted 1 year ago #

    I have the same problem. There needs to be a "save picture" button or something. How do I create it?

  8. Florence
    Member
    Posted 1 year ago #

    Never mind, I figured it out!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic