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

Reply To: Ajax Search to respect visibility set by B2BKing

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

#37413
erikleirdalerikleirdal
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;
}