Notifications
Clear all

[Closed] change password field

3 Posts
3 Users
1 Reactions
3,241 Views
Posts: 1
Topic starter
(@weimar)
New Member
Joined: 6 years ago

Greetings, how can I disabled the password change fields?

2 Replies
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

There is no option to disable password field. But this code may work. Please try it:

function my_custom_account_fields( $fields ){
$remove_fields = array('user_pass');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( wpfval($field, 'name') && in_array($field['name'], $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'my_custom_account_fields');

Put this code in current active WordPress theme functions.php file.

How to Easily Add Custom Code in WordPress (without Breaking Your Site)

VereK
Posts: 522
(@verek)
Honorable Member
Joined: 7 years ago

It might be easier (especially if you want to revert at some point) to "pointer-events: none;" the password fields in Style Settings CSS?