HUSKY - Product Filter for WooCommerce

woof_text_urlencode

Controls whether filter values in the URL query string should be URL-encoded, enabling special character handling in search parameters.

Parameter

$encode (int) — Integer flag (0 or 1) — 0 means no encoding, 1 means filter values will be urlencode()'d

Quelldatei

index.php:2053

Codebeispiel

add_filter('woof_text_urlencode', function($encode) {
    // Enable URL encoding for special characters
    return 1;
});

Verwendungshinweise

  • Located in the get_request_data() method which sanitizes and processes $_GET parameters.
  • When enabled, filter values are passed through urlencode() after trimming slashes.
  • The 'woof_text' key specifically has '+' characters replaced with spaces for security.