| @@ -1,146 +1,163 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * bbPress User Profile Edit Part | |
| 5 | - * | |
| 6 | - * @package bbPress | |
| 7 | - * @subpackage Theme | |
| 8 | - */ | |
| 9 | - | |
| 10 | -// Exit if accessed directly | |
| 11 | -defined( 'ABSPATH' ) || exit; | |
| 12 | -?> | |
| 13 | - | |
| 14 | -<form id="bbp-your-profile" class="bbp-your-profile" method="post" enctype="multipart/form-data"> | |
| 15 | - | |
| 16 | - <?php do_action( 'bbp_user_edit_before' ); ?> | |
| 17 | - | |
| 18 | - <fieldset class="bbp-form"> | |
| 19 | - <legend><?php esc_html_e( 'Name', 'forumax' ) ?></legend> | |
| 20 | - | |
| 21 | - <div class="row g-3"> | |
| 22 | - | |
| 23 | - <?php do_action( 'bbp_user_edit_before_name' ); ?> | |
| 24 | - | |
| 25 | - <div class="column-md-6"> | |
| 26 | - <label for="first_name" class="mb-2"><?php esc_html_e( 'First Name', 'forumax' ) ?></label> | |
| 27 | - <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" placeholder="<?php esc_attr_e('Enter First Name', 'forumax'); ?>" class="regular-text" /> | |
| 28 | - </div> | |
| 29 | - | |
| 30 | - <div class="column-md-6"> | |
| 31 | - <label for="last_name" class="mb-2"><?php esc_html_e( 'Last Name', 'forumax' ) ?></label> | |
| 32 | - <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" placeholder="<?php esc_attr_e('Enter Last Name', 'forumax'); ?>" class="regular-text" /> | |
| 33 | - </div> | |
| 34 | - | |
| 35 | - <div class="column-md-6"> | |
| 36 | - <label for="nickname" class="mb-2"><?php esc_html_e( 'Nickname', 'forumax' ); ?></label> | |
| 37 | - <input type="text" name="nickname" id="nickname" value="<?php bbp_displayed_user_field( 'nickname', 'edit' ); ?>" placeholder="<?php esc_attr_e('Enter Nickname', 'forumax'); ?>" class="regular-text" /> | |
| 38 | - </div> | |
| 39 | - | |
| 40 | - <div class="column-md-6"> | |
| 41 | - <label for="display_name" class="mb-2"> | |
| 42 | - <?php esc_html_e( 'Display Name', 'forumax' ) ?> | |
| 43 | - </label> | |
| 44 | - <?php bbp_edit_user_display_name(); ?> | |
| 45 | - </div> | |
| 46 | - | |
| 47 | - <?php do_action( 'bbp_user_edit_after_name' ); ?> | |
| 48 | - | |
| 49 | - | |
| 50 | - <?php do_action( 'bbp_user_edit_before_contact' ); ?> | |
| 51 | - | |
| 52 | - <div class="column-md-12"> | |
| 53 | - <label for="url" class="mb-2"><?php esc_html_e( 'Website', 'forumax' ) ?></label> | |
| 54 | - <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" placeholder="<?php esc_attr_e('Enter Website URL', 'forumax'); ?>" maxlength="200" class="regular-text code" /> | |
| 55 | - </div> | |
| 56 | - | |
| 57 | - <?php foreach ( bbp_edit_user_contact_methods() as $name => $desc ) : ?> | |
| 58 | - | |
| 59 | - <div> | |
| 60 | - <label for="<?php echo esc_attr( $name ); ?>" class="mb-2"><?php echo apply_filters( 'user_' . $name . '_label', $desc ); ?></label> | |
| 61 | - <input type="text" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" value="<?php bbp_displayed_user_field( $name, 'edit' ); ?>" class="regular-text" /> | |
| 62 | - </div> | |
| 63 | - | |
| 64 | - <?php endforeach; ?> | |
| 65 | - | |
| 66 | - <?php do_action( 'bbp_user_edit_after_contact' ); ?> | |
| 67 | - | |
| 68 | - <?php do_action( 'bbp_user_edit_before_about' ); ?> | |
| 69 | - <div class="column-md-12"> | |
| 70 | - <label for="description" class="mb-2"><?php esc_html_e( 'Biographical Info', 'forumax' ) ?></label> | |
| 71 | - <textarea name="description" id="description" rows="5" cols="30" class="regular-text" value="<?php bbp_displayed_user_field( 'description', 'edit' ); ?>" placeholder="<?php esc_attr_e('Write about yourself', 'forumax'); ?>"></textarea> | |
| 72 | - </div> | |
| 73 | - | |
| 74 | - <?php do_action( 'bbp_user_edit_after_about' ); ?> | |
| 75 | - | |
| 76 | - </div> | |
| 77 | - | |
| 78 | - </fieldset> | |
| 79 | - | |
| 80 | - <fieldset class="bbp-form"> | |
| 81 | - | |
| 82 | - <legend><?php esc_html_e( 'Account', 'forumax' ) ?></legend> | |
| 83 | - | |
| 84 | - <?php do_action( 'bbp_user_edit_before_account' ); ?> | |
| 85 | - | |
| 86 | - <div class="row g-3"> | |
| 87 | - <div class="column-md-6"> | |
| 88 | - <label for="user_login" class="mb-2"><?php esc_html_e( 'Username', 'forumax' ); ?></label> | |
| 89 | - <input type="text" name="user_login" id="user_login" value="<?php bbp_displayed_user_field( 'user_login', 'edit' ); ?>" maxlength="100" class="regular-text" disabled="disabled" /> | |
| 90 | - </div> | |
| 91 | - | |
| 92 | - <div class="column-md-6"> | |
| 93 | - <label for="email" class="mb-2"><?php esc_html_e( 'Email', 'forumax' ); ?></label> | |
| 94 | - <input type="text" name="email" id="email" value="<?php bbp_displayed_user_field( 'user_email', 'edit' ); ?>" maxlength="100" class="regular-text" autocomplete="off" /> | |
| 95 | - </div> | |
| 96 | - </div> | |
| 97 | - | |
| 98 | - <?php bbp_get_template_part( 'form', 'user-passwords' ); ?> | |
| 99 | - | |
| 100 | - <div> | |
| 101 | - <label for="locale" class="mb-2"><?php esc_html_e( 'Language', 'forumax' ) ?></label> | |
| 102 | - <?php bbp_edit_user_language(); ?> | |
| 103 | - </div> | |
| 104 | - | |
| 105 | - <?php do_action( 'bbp_user_edit_after_account' ); ?> | |
| 106 | - | |
| 107 | - </fieldset> | |
| 108 | - | |
| 109 | - <?php if ( ! bbp_is_user_home_edit() && current_user_can( 'promote_user', bbp_get_displayed_user_id() ) ) : ?> | |
| 110 | - | |
| 111 | - <fieldset class="bbp-form"> | |
| 112 | - <legend><?php esc_html_e( 'User Role', 'forumax' ); ?></legend> | |
| 113 | - | |
| 114 | - <?php do_action( 'bbp_user_edit_before_role' ); ?> | |
| 115 | - | |
| 116 | - <?php if ( is_multisite() && is_super_admin() && current_user_can( 'manage_network_options' ) ) : ?> | |
| 117 | - | |
| 118 | - <div> | |
| 119 | - <label for="super_admin" class="mb-2"><?php esc_html_e( 'Network Role', 'forumax' ); ?></label> | |
| 120 | - <label> | |
| 121 | - <input class="checkbox" type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( bbp_get_displayed_user_id() ) ); ?> /> | |
| 122 | - <?php esc_html_e( 'Grant this user super admin privileges for the Network.', 'forumax' ); ?> | |
| 123 | - </label> | |
| 124 | - </div> | |
| 125 | - | |
| 126 | - <?php endif; ?> | |
| 127 | - | |
| 128 | - <?php bbp_get_template_part( 'form', 'user-roles' ); ?> | |
| 129 | - | |
| 130 | - <?php do_action( 'bbp_user_edit_after_role' ); ?> | |
| 131 | - | |
| 132 | - </fieldset> | |
| 133 | - | |
| 134 | - <?php endif; ?> | |
| 135 | - | |
| 136 | - <?php do_action( 'bbp_user_edit_after' ); ?> | |
| 137 | - | |
| 138 | - <fieldset class="submit"> | |
| 139 | - <div> | |
| 140 | - <?php bbp_edit_user_form_fields(); ?> | |
| 141 | - <button type="submit" id="bbp_user_edit_submit" name="bbp_user_edit_submit" class="button submit user-submit fill-brand"> | |
| 142 | - <?php bbp_is_user_home_edit() ? esc_html_e( 'Update Profile', 'forumax' ) : esc_html_e( 'Update User', 'forumax' ); ?> | |
| 143 | - </button> | |
| 144 | - </div> | |
| 145 | - </fieldset> | |
| 146 | -</form> | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * bbPress User Profile Edit Part | |
| 5 | + * | |
| 6 | + * @package bbPress | |
| 7 | + * @subpackage Theme | |
| 8 | + */ | |
| 9 | + | |
| 10 | +// Exit if accessed directly | |
| 11 | +defined('ABSPATH') || exit; | |
| 12 | +?> | |
| 13 | + | |
| 14 | +<form id="bbp-your-profile" class="bbp-your-profile" method="post" enctype="multipart/form-data"> | |
| 15 | + | |
| 16 | + <?php do_action('bbp_user_edit_before'); ?> | |
| 17 | + | |
| 18 | + <fieldset class="bbp-form"> | |
| 19 | + <legend><?php esc_html_e('Name', 'forumax') ?></legend> | |
| 20 | + | |
| 21 | + <div class="frmx-row frmx-g-3 frmx-edit-user"> | |
| 22 | + | |
| 23 | + <?php do_action('bbp_user_edit_before_name'); ?> | |
| 24 | + | |
| 25 | + <div class="frmx-col-lg-6"> | |
| 26 | + <label for="first_name" class="frmx-mb-2"><?php esc_html_e('First Name', 'forumax') ?></label> | |
| 27 | + <input type="text" name="first_name" id="first_name" | |
| 28 | + value="<?php bbp_displayed_user_field('first_name', 'edit'); ?>" | |
| 29 | + placeholder="<?php esc_attr_e('Enter First Name', 'forumax'); ?>" class="regular-text" /> | |
| 30 | + </div> | |
| 31 | + | |
| 32 | + <div class="frmx-col-lg-6"> | |
| 33 | + <label for="last_name" class="frmx-mb-2"><?php esc_html_e('Last Name', 'forumax') ?></label> | |
| 34 | + <input type="text" name="last_name" id="last_name" | |
| 35 | + value="<?php bbp_displayed_user_field('last_name', 'edit'); ?>" | |
| 36 | + placeholder="<?php esc_attr_e('Enter Last Name', 'forumax'); ?>" class="regular-text" /> | |
| 37 | + </div> | |
| 38 | + | |
| 39 | + <div class="frmx-col-lg-6"> | |
| 40 | + <label for="nickname" class="frmx-mb-2"><?php esc_html_e('Nickname', 'forumax'); ?></label> | |
| 41 | + <input type="text" name="nickname" id="nickname" | |
| 42 | + value="<?php bbp_displayed_user_field('nickname', 'edit'); ?>" | |
| 43 | + placeholder="<?php esc_attr_e('Enter Nickname', 'forumax'); ?>" class="regular-text" /> | |
| 44 | + </div> | |
| 45 | + | |
| 46 | + <div class="frmx-col-lg-6"> | |
| 47 | + <label for="display_name" class="frmx-mb-2"> | |
| 48 | + <?php esc_html_e('Display Name', 'forumax') ?> | |
| 49 | + </label> | |
| 50 | + <?php bbp_edit_user_display_name(); ?> | |
| 51 | + </div> | |
| 52 | + | |
| 53 | + <?php do_action('bbp_user_edit_after_name'); ?> | |
| 54 | + | |
| 55 | + | |
| 56 | + <?php do_action('bbp_user_edit_before_contact'); ?> | |
| 57 | + | |
| 58 | + <div class="frmx-col-lg-12"> | |
| 59 | + <label for="url" class="frmx-mb-2"><?php esc_html_e('Website', 'forumax') ?></label> | |
| 60 | + <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field('user_url', 'edit'); ?>" | |
| 61 | + placeholder="<?php esc_attr_e('Enter Website URL', 'forumax'); ?>" maxlength="200" | |
| 62 | + class="regular-text code" /> | |
| 63 | + </div> | |
| 64 | + | |
| 65 | + <?php foreach (bbp_edit_user_contact_methods() as $name => $desc): ?> | |
| 66 | + | |
| 67 | + <div> | |
| 68 | + <label for="<?php echo esc_attr($name); ?>" | |
| 69 | + class="frmx-mb-2"><?php echo apply_filters('user_' . $name . '_label', $desc); ?></label> | |
| 70 | + <input type="text" name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($name); ?>" | |
| 71 | + value="<?php bbp_displayed_user_field($name, 'edit'); ?>" class="regular-text" /> | |
| 72 | + </div> | |
| 73 | + | |
| 74 | + <?php endforeach; ?> | |
| 75 | + | |
| 76 | + <?php do_action('bbp_user_edit_after_contact'); ?> | |
| 77 | + | |
| 78 | + <?php do_action('bbp_user_edit_before_about'); ?> | |
| 79 | + <div class="frmx-col-lg-12"> | |
| 80 | + <label for="description" class="frmx-mb-2"><?php esc_html_e('Biographical Info', 'forumax') ?></label> | |
| 81 | + <textarea name="description" id="description" rows="5" cols="30" class="regular-text" | |
| 82 | + value="<?php bbp_displayed_user_field('description', 'edit'); ?>" | |
| 83 | + placeholder="<?php esc_attr_e('Write about yourself', 'forumax'); ?>"></textarea> | |
| 84 | + </div> | |
| 85 | + | |
| 86 | + <?php do_action('bbp_user_edit_after_about'); ?> | |
| 87 | + | |
| 88 | + </div> | |
| 89 | + | |
| 90 | + </fieldset> | |
| 91 | + | |
| 92 | + <fieldset class="bbp-form"> | |
| 93 | + | |
| 94 | + <legend><?php esc_html_e('Account', 'forumax') ?></legend> | |
| 95 | + | |
| 96 | + <?php do_action('bbp_user_edit_before_account'); ?> | |
| 97 | + | |
| 98 | + <div class="frmx-row frmx-gap-3"> | |
| 99 | + <div class="frmx-col-lg-6"> | |
| 100 | + <label for="user_login" class="frmx-mb-2"><?php esc_html_e('Username', 'forumax'); ?></label> | |
| 101 | + <input type="text" name="user_login" id="user_login" | |
| 102 | + value="<?php bbp_displayed_user_field('user_login', 'edit'); ?>" maxlength="100" | |
| 103 | + class="regular-text" disabled="disabled" /> | |
| 104 | + </div> | |
| 105 | + | |
| 106 | + <div class="frmx-col-lg-6"> | |
| 107 | + <label for="email" class="frmx-mb-2"><?php esc_html_e('Email', 'forumax'); ?></label> | |
| 108 | + <input type="text" name="email" id="email" | |
| 109 | + value="<?php bbp_displayed_user_field('user_email', 'edit'); ?>" maxlength="100" | |
| 110 | + class="regular-text" autocomplete="off" /> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + | |
| 114 | + <?php bbp_get_template_part('form', 'user-passwords'); ?> | |
| 115 | + | |
| 116 | + <div> | |
| 117 | + <label for="locale" class="frmx-mb-2"><?php esc_html_e('Language', 'forumax') ?></label> | |
| 118 | + <?php bbp_edit_user_language(); ?> | |
| 119 | + </div> | |
| 120 | + | |
| 121 | + <?php do_action('bbp_user_edit_after_account'); ?> | |
| 122 | + | |
| 123 | + </fieldset> | |
| 124 | + | |
| 125 | + <?php if (!bbp_is_user_home_edit() && current_user_can('promote_user', bbp_get_displayed_user_id())): ?> | |
| 126 | + | |
| 127 | + <fieldset class="bbp-form"> | |
| 128 | + <legend><?php esc_html_e('User Role', 'forumax'); ?></legend> | |
| 129 | + | |
| 130 | + <?php do_action('bbp_user_edit_before_role'); ?> | |
| 131 | + | |
| 132 | + <?php if (is_multisite() && is_super_admin() && current_user_can('manage_network_options')): ?> | |
| 133 | + | |
| 134 | + <div> | |
| 135 | + <label for="super_admin" class="frmx-mb-2"><?php esc_html_e('Network Role', 'forumax'); ?></label> | |
| 136 | + <label> | |
| 137 | + <input class="checkbox" type="checkbox" id="super_admin" name="super_admin" <?php checked(is_super_admin(bbp_get_displayed_user_id())); ?> /> | |
| 138 | + <?php esc_html_e('Grant this user super admin privileges for the Network.', 'forumax'); ?> | |
| 139 | + </label> | |
| 140 | + </div> | |
| 141 | + | |
| 142 | + <?php endif; ?> | |
| 143 | + | |
| 144 | + <?php bbp_get_template_part('form', 'user-roles'); ?> | |
| 145 | + | |
| 146 | + <?php do_action('bbp_user_edit_after_role'); ?> | |
| 147 | + | |
| 148 | + </fieldset> | |
| 149 | + | |
| 150 | + <?php endif; ?> | |
| 151 | + | |
| 152 | + <?php do_action('bbp_user_edit_after'); ?> | |
| 153 | + | |
| 154 | + <fieldset class="submit"> | |
| 155 | + <div> | |
| 156 | + <?php bbp_edit_user_form_fields(); ?> | |
| 157 | + <button type="submit" id="bbp_user_edit_submit" name="bbp_user_edit_submit" | |
| 158 | + class="button submit user-submit fill-brand"> | |
| 159 | + <?php bbp_is_user_home_edit() ? esc_html_e('Update Profile', 'forumax') : esc_html_e('Update User', 'forumax'); ?> | |
| 160 | + </button> | |
| 161 | + </div> | |
| 162 | + </fieldset> | |
| 163 | +</form> | |