HUSKY - Product Filter for WooCommerce

woof_ext_custom_title_by_onsales

フロントエンドビューとJavaScriptローカライゼーション配列の両方で、「セール中」フィルターチェックボックスに表示されるラベルテキストのカスタマイズを可能にします。

パラメーター

$label (string) — デフォルトの翻訳済みラベル文字列。通常は「On sale」です。

ソースファイル

ext/by_onsales/index.php:20

ext/by_onsales/views/woof.php:7

コード例


add_filter('woof_ext_custom_title_by_onsales', function($label) {
    return __('Special Offers', 'my-theme');
});

使用上の注意

  • 2箇所で適用されます: index.php は self::$includes を介して js_lang_custom を設定し、views/woof.php はレンダリング用に $woof_ext_onsales_label を設定します。
  • デフォルトは「On sale」の翻訳です。
  • $this->index = 'onsales' がJSキーを決定する拡張システムの一部です。