Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get users by role wordpress

$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);
						}
					}
				}
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #users #role #wordpress
ADD COMMENT
Topic
Name
6+9 =