HUSKY - Products Filter Professional for WooCommerce

woof-set-shortcode-taxonomyattr-behaviour

woof_set_shortcode_taxonomyattr_behaviour

[woof_products] ve [woof_products_ids_prediction] shortcode'larında taxonomies niteliğinin davranışını değiştirmeye olanak tanır.

Parametreler

$taxonomies_string (string) — shortcode niteliğinden gelen taxonomies dizisi

Kaynak Dosya

index.php

Kod Örneği

add_filter('woof_set_shortcode_taxonomyattr_behaviour', function($taxonomies_string) {
    // Force specific taxonomy to always be included
    $additional = 'product_tag:featured,on_sale';
    if (!empty($taxonomies_string)) {
        $taxonomies_string .= '+' . $additional;
    } else {
        $taxonomies_string = $additional;
    }
    return $taxonomies_string;
});

Kullanım Notları

  • Bu kodu temanızın functions.php dosyasına veya özel bir plugin'e ekleyin.
  • Bu hook, filtreleme işlemi sırasında uygulanır — değişiklikler anında yürürlüğe girer.
  • Geri çağırma fonksiyonundan her zaman beklenen değer tipini döndürün.