This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Including user roles when do user search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Including user roles when do user search Reply To: Including user roles when do user search

#30696
zpintar27zpintar27
Participant

I’ve just tried your code, but doesn’t work!
When it’s applied no user is searched out. Are you sure that’s code is OK? (because I found some typos)

add_filter("asp_query_args", "asp_query_args_change", 10, 2);
function asp_query_args_change($args, $search_id) {
	if ($search_id == 2) {
	
	// Roles list
	$roles = array('um_clanovi-udruge');

	global $wpdb;
	$args['user_meta_filter'][] = array(
		'key'     => $wpdb->base_prefix."capabilities",
		'value'   => $roles,
		'operator' => 'IN',
		'allow_missing' => false
	);
	}
  return $args;
}