$user = new WP_User( $user->ID ); if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as $role ) echo ucfirst($role); }
Super easy way to add custom fields to the user profile on WordPress. This will take you 3 seconds to implement. function modify_contact_methods($profile_fields) { // Add new fields – this can be as many as you like $profile_fields[‘cool_new_field’] = ‘Twitter Username’; // Remove old fields unset($profile_fields[‘some_existing_field_you_hate’]); return $profile_fields; } add_filter(‘user_contactmethods’, ‘modify_contact_methods’); //And if you […]