Hi, I would like to delete all users except users that have any log or contact with edd.
Registered Spam bots are also in subscriber role same a to many customers with expired licenses etc.
How can I change role of all add customers at once?
I tried this function that I found on github but it didn’t change anything on users.
add_filter( 'edd_insert_user_args', 'wpb_edd_customer_user_role', 10, 2 );if( !function_exists('wpb_edd_customer_user_role') ):
function wpb_edd_customer_user_role( $user_args, $user_data ) {
$cart_price = edd_get_cart_total();
if( floatval($cart_price) <= 0 ){
$user_args['role'] = 'free_customer';
}else {
$user_args['role'] = 'premium_customer';
}
return $user_args;
}
endif;
If you have any idea please let me know or maybe a sql command that does the same job.