HUSKY - Product Filter for WooCommerce

woof_draw_products_html

Filters the rendered HTML of the [woof_products] shortcode before it is returned as part of the AJAX response in woof_draw_products. Use this filter to wrap, transform, or modify the product listing HTML after it has been generated by the shortcode.

Parameters

$html (string) — The rendered HTML from do_shortcode().

$shortcode_str (string) — The full shortcode string that was executed.

Source File

index.php, line 2741

Code Example


add_filter("woof_draw_products_html", function ($html, $shortcode_str) {
    // Add a wrapper div around the products
    return "<div class="woof-custom-wrapper">" . $html . "</div>";
}, 10, 2);

Usage Notes

  • Add this code to your theme's functions.php file or a custom plugin.
  • The hook fires only during AJAX requests via the woof_draw_products handler.
  • Accepts 2 parameters — remember to declare $a, $b in your function signature.