WordPress интерфейс редактировать форму профиля - изменить аватар - PullRequest
0 голосов
/ 24 августа 2018

У меня есть форма для редактирования профиля из внешнего интерфейса. У меня внутри что-то такое:

do_action ( 'edit_user_profile', $ current_user);

Этот код выводит его: https://www.screencast.com/t/kIDEcbeD, если я вошел как администратор. Если подписчик вошел в систему, там ничего нет - я вижу только кнопку отправки.

1 Ответ

0 голосов
/ 28 августа 2018

Есть еще код для анализа:

                <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>
...