HUSKY - WooCommerce Products Filter Professional

woof_use_wp_cache

Hook woof_use_wp_cache is to enable object cache wp-cache which is more optimized. Showed good results in the tests. ATTENTION: it is obligatorily should be installed any plugin of object caching for WordPress, another way no effect. Example: https://wordpress.org/plugins/w3-total-cache/ To enable wp object cache into file functions.php of the current WordPress theme add next code:

add_filter('woof_use_wp_cache', function($is){
    return true;
});
Information: By default, object caching in WordPress is non-persistent, which means that it works within a single HTTP request (only for generating one page) and does not work between different requests (when visiting a new page, the cache from the old page is not used). As the page is generated, the data is stored in the cache (RAM) and taken from there when the same data is requested again in the code. For example, this is why the get_option() function does not make a request to the database [...]

woof_husky_query_post__in

From v.2.2.9/v.1.2.9

  • There are two Husky filter modes:
    • adding a search result with post__in (enabled by default). The advantage of this mode is reliability, because the search takes place in a separate query and all JOINs will not conflict with the main query.
    • the second one (if you pass false on the hook) – works with the main request and adds it in the old fashioned way via post_where. Pros: does not increase the number of queries to the database.
    • add_filter('woof_husky_query_post__in', function ($do) {
          return false;
      });
      
       
[...]

woof_meta_options_separator

From v.2.2.6 Need to replace comma separator in options , useful if meta contains a comma as part of an option, example:

add_filter('woof_meta_options_separator', function ($sep) {
    $sep = '|';
    return $sep;
});
    [...]

woof_exclude_existing_variations

From v.2.2.6 Improves in stock search. Need because not everyone needs variations in the search results and also allows avoid excess requests. By default is false. Example:

add_filter('woof_exclude_existing_variations', function ($init) {
    $init = true;
    return $init;
});
    [...]

woof_mobile_btn_place_container

From v.2.2.6 Allows to override the selector where the mobile filter button should appear. By default is css class ‘.woocommerce-products-header‘. Code example:

add_filter('woof_mobile_btn_place_container', function ($selector) {
    $selector = '#my_woof_btn_place';//your id or css class (.my_woof_btn_place) 
    return $selector;
});
By default is:   [...]

woof_image_allow_term_desc

From v.2.2.6 By default a description of the term is added for pictures, now it can be turned off. By default is true. Example:

add_filter('woof_image_allow_term_desc', function ($show) {
    return false;
});
  [...]

woof_seo_request_literals

From v.2.2.6/1.2.6 Uses for extension ‘SEO URL request‘ – allows to add possible literal variables that can be inserted into the SEO rules fields. Example in the field: ‘Page title {my_seo_word_1}‘.

add_filter('woof_seo_request_literals', function ($vars) {
    $vars = "Any text here!";//any code for any literal key
    return $vars;
});
  [...]

woof_override_seo_request_uri

From v.2.2.6/1.2.6 Uses for extension ‘SEO URL request‘ – passes the current URL. Need to adapt different servers if necessary [...]

woof_seo_rules_langs

From v.2.2.6/1.2.6 Uses for extension ‘SEO URL request‘ and allows to add additional languages for plugins like Polylang Example:

add_filter('woof_seo_rules_langs',function($langs){
	$langs = array_merge($langs, array('en_US', 'es_ES'));
	return array_unique($langs);
});
  [...]

woof_quick_search_products_limit

By default count of product is limited to 10,000. But you can extend this value:

add_filter('woof_quick_search_products_limit', function($count){
    return 30000;
});
But remember – more products – > more strong server you need (RAM, CPU)!   [...]