Notifications
Clear all

change password field

3 Posts
3 Users
1 Likes
2,714 Views
weimar
Posts: 1
Topic starter
(@weimar)
New Member
Joined: 4 years ago

Greetings, how can I disabled the password change fields?

Topic Tags
2 Replies
Robert
Posts: 9912
Admin
(@robert)
Support Team
Joined: 7 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)

Reply
VereK
Posts: 393
(@verek)
Honorable Member
Joined: 5 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?

Reply