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