Disable user profile editing for one user

If you want to completerly remove the possibility for an user to access on profile, you can Give admin possibility to choose which user can access on profile and which not Remove the profile link from menu and from admin bar Ensure the profile is not accessible even if accessed directly by manually typing address … Read more

Calling custom profile fields?

Try instead $user_contactmethods[‘work’] = __(‘I work for…’); and <?php echo get_user_meta($current_user->ID,’work’,true);?> where the array index is ‘work’ instead of ‘I work for…’, i.e. lowercase and without any spaces.

How to make first_name and last_name required fields in user profile?

You could check the $_POST variable when updating the user profile page. I would hook into user_profile_update_errors and do something along those lines. This filter will not save to DB if errors are found. add_filter(‘user_profile_update_errors’, ‘wpse_236014_check_fields’, 10, 3); function wpse_236014_check_fields($errors, $update, $user) { // Use the $_POST variable to check required fields if( empty($_POST[‘first_name’]) ) … Read more

Saving custom profile fields

Ok, I was doing it wrong, here’s a working solution, based on Justin Tadlock’s tutorial. <?php /* Add custom profile fields (call in theme : echo $curauth->fieldname;) */ add_action( ‘show_user_profile’, ‘my_show_extra_profile_fields’ ); add_action( ‘edit_user_profile’, ‘my_show_extra_profile_fields’ ); function my_show_extra_profile_fields( $user ) { ?> <?php if(user_can($user->ID, “paying_member”)) : ?> <h3>Extra profile information</h3> <table class=”form-table”> <tr> <th><label for=”paypal_account”>Paypal</label></th> … Read more