After the upgrade does not work the filter categories
-
I need for users (not administrators) to exclude from the site search a particular category. Code written, all worked fine until the latest updates. On what exactly update stopped working I do not know. Most likely 3.9 or 4.0.
Worked the following code:
function search_filter ($query) { ???? if (($ query-> is_search) and! current_user_can ('administrator')) { ?????? $query-> set ('cat', '-14'); ???? } } add_action ('pre_get_posts', 'search_filter');
$query-> set (‘category__not_in’, ’14’); does not work
add_filter – does not workCode is inserted into the functions.php of the theme.
Anyone know why suddenly stopped working this code?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘After the upgrade does not work the filter categories’ is closed to new replies.