Members are given an expiry, stored in the database as 'expire_date' in wp_postmeta.
I want to get a list of members in a query that have active subscriptions (not expired). I'm aware of subscription_status as an argument to MS_Model_Member::get_members, but that isn't working, either because status isn't changing to expired or because it's bugged.
I've also tried manually comparing using a meta_query but unfortunately it looks like the expire_date is stored against a post, not a user, and MS_Model_Member::get_members ultimately calls WP_User_Query.
Below is my query:
$args = array(
//'membership_id' => 18, // 18,31
'subscription_status' => 'active',
'orderby' => 'meta_value', // company_name
'order' => 'ASC',
'meta_key' => 'company_name',
'number' => $per_page,
'offset' => $offset,
'count_total' => true,
'meta_query' => array(
array( // Means they must be a valid member
'key' => 'company_name',
'value' => '',
'compare' => '!='
),
)
);
And I have tried including a second query param for expire_date:
Members are given an expiry, stored in the database as 'expire_date' in wp_postmeta.
I want to get a list of members in a query that have active subscriptions (not expired). I'm aware of
subscription_status
as an argument toMS_Model_Member::get_members
, but that isn't working, either because status isn't changing toexpired
or because it's bugged.I've also tried manually comparing using a
meta_query
but unfortunately it looks like the expire_date is stored against a post, not a user, andMS_Model_Member::get_members
ultimately callsWP_User_Query
.Below is my query:
And I have tried including a second query param for expire_date:
So I guess my question is, how do members 'expire'? I believe the WP cron to be running as expected. Anything else I should be aware of?