How can I hide the new password and current password fields?

I m looking for the variable names for new password & current password that will allow me to hide both fields, I have seen the php snippet that can aid me with removing certain fields in the user’s settings. however, I have not seen the variable names for both fields.

thanks for your help!

Hi,

If you mean the Current Password and New Password fields in the profile settings, then their field names are:

current_password
password

​I hope this is helpful to you.

What is the php snippet for that?

Revert to the snippet you mentioned in your first post and replace the field name by the ones andrii gave you.

unset(…)

1 Like

Hi,

Please use this PHP snippet:

add_filter(
	'hivepress/v1/forms/user_update',
	function( $form ) {
		unset( $form['fields']['current_password'] );
		unset( $form['fields']['password'] );

		return $form;
	},
	1000
);

​I hope this is helpful to you.

Thanks!