Notifications
Clear all

change password field

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

Greetings, how can I disabled the password change fields?

Topic Tags
2 Replies
Robert
Posts: 9979
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: 402
(@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