## php – Error in suggestion in search area

Question

I have a problem and I need help.

On my website I customized the search area. I let it display only the categories I chose using the category ID.

Example:

Let’s say I have 10 categories on the entire site but I only want 5.

function SearchFilter($query) { if($query->is_search && ! is_admin() )
{
$query->set('cat','3,4,5,6,7'); } return$query;
}