/* get all role in wordpress in associative key = role(slug) => value(Role Display name) by joshiyogesh0333@gmail.com */
function get_role_names() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
return $wp_roles->get_names();
}
$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);
}
}
}
function get_role_names() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
return $wp_roles->get_names();
}