woof_text_search_ids
Allows external search engines (e.g. SearchWP) to override the product IDs returned by the text search, replacing the default WooCommerce search results entirely.
Parameters
$external_ids (null|array) — Null by default; return an array of post IDs to override the built-in text search results
$search_text (string) — The raw search text entered by the user
$options (array) — The search options array including max_posts, page, and other configuration
Source File
ext/by_text/index.php:854
Code Example
add_filter('woof_text_search_ids', function($ids, $search_text, $options) {
// Integrate with a custom search engine
if (function_exists('my_custom_search')) {
return my_custom_search($search_text, $options);
}
return $ids;
}, 10, 3);
Usage Notes
- If the filter returns an array, that array is immediately returned as the search results.
- This is the primary integration point for replacing the built-in text search with external search services.
- The options array has 'page' parameter unset before passing to the default search.