EDIT
start and end date is following the date format. But you are using NUMERIC type casting in meta query. You need to use DATE type like
array(
'key' => 'user_registered',
'value' => $start_date,
'compare' => '>',
'type' => 'DATE'
),
array(
'key' => 'user_registered',
'value' => $end_date,
'compare' => '<=',
'type' => 'DATE'
)
Hope that this will help you.
Ahh…there have another problem. You are saving the data in $current_user_id
but you are not using this variable in third array. Try this once
array(
'key' => 'referral_id',
'value' => $current_user_id,
'compare'=> '=',
'type' => 'NUMERIC'
)
Full Code:
$args = array(
'meta_query' => array(
array(
'relation' => 'AND',
array(
'key' => 'user_registered',
'value' => $start_date,
'compare' => '>',
'type' => 'DATE'
),
array(
'key' => 'user_registered',
'value' => $end_date,
'compare' => '<=',
'type' => 'DATE'
),
array(
'key' => 'referral_id',
'value' => $current_user_id,
'compare'=> '=',
'type' => 'NUMERIC'
)
)
)
);
$users = get_users($args);
Try my full code now.