• Hi

    I have a form for editing profile from the frontend. I ‘ve got something like that inside it:

    do_action('edit_user_profile',$current_user);

    This code outputs it: https://www.screencast.com/t/kIDEcbeD if I’m logged in as admin. If the subscriber is logged in there is nothing – I see only submit button.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @mlyczko,

    Are you using an specific plugin for this or a feature of an specific theme? That way, we’ll be able to help you better ??

    Thread Starter mlyczko

    (@mlyczko)

    That’s my custom code in a plugin. There is a more code to analyze:

                    <form method="post" id="edituser" action="<?php the_permalink(); ?>">
                        <p class="form-username">
                            <label for="first_name"><?php _e('First name', 'example'); ?></label>
                            <input class="text-input" name="first_name" type="text" id="first_name" value="<?php the_author_meta( 'first_name', $current_user->ID ); ?>" />
                        </p><!-- .form-username -->
                        <p class="form-username">
                            <label for="last_name"><?php _e('Last name', 'example'); ?></label>
                            <input class="text-input" name="last_name" type="text" id="last_name" value="<?php the_author_meta( 'last_name', $current_user->ID ); ?>" />
                        </p><!-- .form-username -->
                        <p class="form-email">
                            <label for="user_email"><?php _e('E-mail', 'example'); ?></label>
                            <input class="text-input" name="user_email" type="text" id="user_email" value="<?php the_author_meta( 'user_email', $current_user->ID ); ?>" />
                        </p><!-- .form-email -->
                        <p class="form-url">
                            <label for="url"><?php _e('Website', 'example'); ?></label>
                            <input class="text-input" name="url" type="text" id="url" value="<?php the_author_meta( 'user_url', $current_user->ID ); ?>" />
                        </p><!-- .form-url -->
                        <p class="form-phone">
                            <label for="tc_phone"><?php _e('Phone', 'example'); ?></label>
                            <input class="text-input" name="tc_phone" type="text" id="tc_phone" value="<?php echo $phone_meta_value; ?>" />
                        </p><!-- .form-phone -->
                        <p class="form-password">
                            <label for="pass1"><?php _e('Password', 'example'); ?> </label>
                            <input class="text-input" name="pass1" type="password" id="pass1" />
                        </p><!-- .form-password -->
                        <p class="form-password">
                            <label for="pass2"><?php _e('Repeat password', 'example'); ?></label>
                            <input class="text-input" name="pass2" type="password" id="pass2" />
                        </p><!-- .form-password -->
                        <p class="form-textarea">
                            <label for="description"><?php _e('About me', 'example') ?></label>
                            <textarea name="description" id="description" rows="3" cols="50"><?php the_author_meta( 'description', $current_user->ID ); ?></textarea>
                        </p><!-- .form-textarea -->
                        <?php 
                            //action hook for plugin and extra fields
                            do_action('edit_user_profile',$current_user); 
                        ?>
                        <p class="form-submit">
                            <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'example'); ?>" />
                            <?php wp_nonce_field( 'update-user' ) ?>
                            <input name="action" type="hidden" id="action" value="update-user" />
                        </p>
                    </form>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress frontend edit profile form – change avatar’ is closed to new replies.