Support » Plugin: Avatar Manager » Upload Avatar in frontend

  • Angelo

    (@klish)


    Is there is a way to add the upload avatar in custom page for user to upload their own avatar, instead of doing from the admin page only?

    Iam tryin with something like this

    <fieldset>
        <legend class="screen-reader-text"><span><?php _e('Select Image','avatar-manager'); ?></span></legend>
        <p>
            <label class="description" for="avatar-manager-upload">
                <?php _e('Choose an image from your computer:','avatar-manager'); ?>
            </label>
            <br>
            <input name="avatar_manager_import" type="file" id="avatar-manager-upload">
            <input name="avatar_manager_submit" type="submit" class="button" value="<?php esc_attr_e('Agregar Imagen Seleccionada','avatar-manager'); ?>">
        </p>
        <?php if(current_user_can('upload_files')&&did_action('wp_enqueue_media')): ?>
            <p>
                <label class="d-none description" for="avatar-manager-choose-from-library-link">
                    <?php _e('Or choose an image from your media library:','avatar-manager'); ?>
                </label>
                <br>
                <?php $modal_update_href=add_query_arg(array('action'=>'update','avatar_manager_action'=>'set-avatar','user_id'=>$profileuser->id),self_admin_url(is_profile_page?'profile.php':'user-edit.php')); ?>
                    <a class="button d-none" data-choose="<?php esc_attr_e('Choose a Custom Avatar','avatar-manager'); ?>" data-update="<?php esc_attr_e('Set as avatar','avatar-manager'); ?>" data-update-link="<?php echo wp_nonce_url($modal_update_href,'update-user_'.$profileuser->id); ?>" id="avatar-manager-choose-from-library-link">
                        <?php _e('Choose Image','avatar-manager'); ?>
                    </a>
            </p>
            <?php endif; ?>
    </fieldset>

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter Angelo

    (@klish)

    This is the error
    Warning: Use of undefined constant IS_PROFILE_PAGE - assumed 'IS_PROFILE_PAGE' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\my-sites\site\wp-content\themes\the-theme\author.php on line 42

    • This reply was modified 5 years ago by Angelo.
Viewing 1 replies (of 1 total)
  • The topic ‘Upload Avatar in frontend’ is closed to new replies.