Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ajax Search to respect visibility set by B2BKing › Reply To: Ajax Search to respect visibility set by B2BKing
April 5, 2022 at 2:42 pm
#37413
Participant
I found this online, from the request from B2BKing themself. But adding this to code snippets doesnt seem to do the trick. Hidden products still show up in Ajax Search.
add_filter(‘asl_query_args’, ‘asl_query_args_postin’, 10, 1);
function asl_query_args_postin($args) {
$args[‘post_in’] = is_array($args[‘post_in’]) ? $args[‘post_in’] : array();
$args[‘post_in’] = array_merge($args[‘post_in’], array(1,2,3));
return $args;
}