Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topher1kenobe/9e86b0b112739d0b397ede76e2284ea4 to your computer and use it in GitHub Desktop.
Save topher1kenobe/9e86b0b112739d0b397ede76e2284ea4 to your computer and use it in GitHub Desktop.
array_intersect meta_query
$meta_query = [
'meta_key' => 'pmp_required_levels',
'meta_value' => get_pmpro_subscription_ids( get_current_user_id() ),
'meta_compare' => 'IN',
'post_type' => 'li_resources',
];
// value holds an array like this
Array
(
[0] => 6
[1] => 7
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment