I have another question, how would i setup 2 member directories in 1 page?
I have 2 buttons that show member directory ‘1667’ and ‘2425’. Currently i have this code, but some members don’t filter right, like some of them don’t show up in the second member directory shortcode.
The only way i found is to create a new page, add member directory and then add it to iframe.. But it’s a pretty bad solution
function custom_meta_value_prepare_user_query_args( $query_args, $directory_data ) {
$iesko_id = '1667';
$turi_id = '2425';
if( $directory_data['form_id'] == $iesko_id ) {
$query_args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'multi_tipas',
'value' => serialize( 'turius, ieskaus' ),
'compare' => 'LIKE'
),
array(
'key' => 'multi_tipas',
'value' => serialize( 'ieskaus' ),
'compare' => 'LIKE'
),
);
}
if($directory_data['form_id'] == $turi_id){
$query_args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'multi_tipas',
'value' => serialize( 'turius, ieskaus' ),
'compare' => 'LIKE'
),
array(
'key' => 'multi_tipas',
'value' => serialize( 'turius' ),
'compare' => 'LIKE'
),
);
}
return $query_args;
}