Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ajax Search Pro and ACF › Reply To: Ajax Search Pro and ACF
December 29, 2022 at 10:48 pm
#40668
Participant
Ok, I found these two pages:
And added this to my functions.php file:
add_filter('asp_query_args', 'asp_add_my_meta_filter', 10, 1);
function asp_add_my_meta_filter( $args ) {
$args['search_type'] = array('users');
$args['post_meta_filter'] = array(
array(
'key' => 'public_profile', // meta key
'value' => 'yes', // int|float|string|array|timestamp|datetime
'operator' => 'LIKE',
'allow_missing' => false // allow match if this custom field is unset
));
return $args;
}
But it’s still returning users with public_profile set to “no”.
Any ideas?