#8158
Vladimir
Keymaster

In the provided piece of code the key line is missed:


add_action('admin_init', 'user_profile_fields_disable');

It links your function to the hook which executes it.

Also pay attention that JavaScript code disables only input fields. It can not disable any other visible element. If you wish to hide some element on a page you should use another jQuery code, like


jQuery('#div_id').hide();