woof_get_request_data
Uses in data-gate function of the plugin: index.php -> public function get_request_data() – it is first function in the plugin which get search request data
Can be used for any manipulation with request data if its necessary
Parameters
$data (array) — the request data array
Source File
index.php
Code Example
add_filter('woof_get_request_data', function($data) {
// Add custom filter parameter programmatically
if (!isset($data['min_price']) AND isset($_GET['custom_min'])) {
$data['min_price'] = floatval($_GET['custom_min']);
}
if (!isset($data['max_price']) AND isset($_GET['custom_max'])) {
$data['max_price'] = floatval($_GET['custom_max']);
}
return $data;
});
Usage Notes
- Add this code to your theme's
functions.phpfile or a custom plugin. - The hook is applied during the filtering process — changes take effect immediately.
- Always return the expected value type from the callback function.