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