I have created a plugin where employers are able to search freelancers and hire them. I have added restrict content pro plugin to handle subscription for freelancers. there are 4
levels. level 0
or none
is free and I only want the freelancers to show up on results page if they are in level 1
, 2
or 3
. I have tried the following but no luck.
$freelancers = get_users( [
'role' => 'fmaa_freelancer',
'number' => -1,
'orderby' => 'display_name',
'order' => 'ASC',
'meta_query' => array(
'key' => 'rcp_user_level',
'value' => [ 1, 2, 3 ],
'compare' => 'IN'
)
] );
I have also tried the rcp_subscription_level
and rcp_user_subscription_level
but its not working. I tried to look up for the user meta key in database but no luck. It seems like restrict content pro has its own separate tables.
To query users based on their subscription level in RCP, you’ll need to join the RCP tables with the WordPress users table.