Works from v.1.1.6/2.1.6. PHP 5.4 is minimum requirement.
Drop the next script example in the functions.php file of the current wp theme:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | add_filter('send_headers', function() { if ($_SERVER['SCRIPT_URL'] === '/' OR $_SERVER['SCRIPT_URL'] === '/shop/') { global $WOOF; if (!$WOOF->is_isset_in_request_data($WOOF->get_swoof_search_slug())) { $woof_last_search_request = $WOOF->storage->get_val('woof_last_search_request'); if (!empty($woof_last_search_request) AND is_array($woof_last_search_request)) { unset($woof_last_search_request['wc-ajax']); unset($woof_last_search_request['page']); unset($woof_last_search_request['paged']); //*** $_GET = $woof_last_search_request; add_filter('woof_get_request_data', function() use($woof_last_search_request) { return $woof_last_search_request; }); } } } }, 9999); |
