Opened 8 months ago
Closed 8 months ago
#1955 closed defect (fixed)
Bug in form-user-edit.php file.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.2 |
| Component: | Users | Version: | 2.1.2 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Using bbPress 2.1.2, WordPress 3.4.2.
Needed to add some custom contact fields to user profile. User edit form won't show custom contact fields after save.
Steps to reproduce..
Add these lines to functions.php :
add_filter('user_contactmethods', 'ztwp_extra_user_contactmethods');
function ztwp_extra_user_contactmethods() {
return array('phone' => __('Phone'));
}
function ztwp_save_extra_user_profile_fields( $user_id ) {
if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
update_user_meta( $user_id, 'phone', $_POST['phone'] );
}
Open user profile via bbPress. You should see field for phone number. Enter phone no and save. After save you won't see the number prefilled in the field. The number was saved nevertheless (check user profile via wp-admin).
I found and fixed the bug. Please include this in your next releases.
Patch for file wp-content/plugins/bbpress/bbp-theme-compat/bbpress/form-user-edit.php (line 62):
--- <input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'name' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" /> +++ <input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( bbp_get_displayed_user_field( $name ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
Change History (2)
comment:1
johnjamesjacoby — 8 months ago
- Component changed from General to Users
- Milestone changed from Awaiting Review to 2.2
comment:2
johnjamesjacoby — 8 months ago
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
(In [4227]) User Edit: