$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
//The user has the "author" role
}
$getDealers = get_users(
array(
'role' => 'dealership',
'orderby' => 'nickname'
)
);
if($getDealers) {
foreach($getDealers as $getDealer) {
if($getDealer->ID == $new_user_data->dealer){
update_user_meta($new_user_id, 'yews_data_dealership_name', $getDealer->nickname);
}
}
}