Skip to content

Instantly share code, notes, and snippets.

@Avakulenko
Last active December 1, 2015 13:39
Show Gist options
  • Select an option

  • Save Avakulenko/a6d762ab39d9df386a9d to your computer and use it in GitHub Desktop.

Select an option

Save Avakulenko/a6d762ab39d9df386a9d to your computer and use it in GitHub Desktop.
if ($found_users) {
$salons_sql = "
SELECT DISTINCT um.meta_value
FROM $wpdb->usermeta AS um
WHERE um.meta_key = '_crb_user_salon'
AND um.meta_value<>''
AND um.user_id IN(".implode(', ', array_fill(0, count($found_users), '%s')).")
";
$salons_query = call_user_func_array(array($wpdb, 'prepare'), array_merge(array($salons_sql), $found_users));
$found_salons = $wpdb->get_col($salons_query);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment