add_filter( 'wcml_is_cache_enabled_for_switching_currency', 'the_callback_function', 10, 1 );
- 类型
- filter
- 类别
- 多货币功能
- WooCommerce Multilingual 版本
- 4.3.3
说明
此过滤器会将 ?wcmlc={currency_code} 添加到 URL 中,用于指定包含货币代码的查询字符串。当您的站点启用了缓存且无法正确显示货币更改时,这非常有用。
参数
传递给此过滤器的参数只有一个:$enabled
- (bool) 设置为 true 以启用过滤器。
使用示例
示例
/** * Enable the query string argument on currency change. */ add_filter( 'wcml_is_cache_enabled_for_switching_currency', '__return_true' );
相关钩子
wcml_custom_prices_fields_labels, wcml_geolocation_get_user_country, wcml_user_store_strategy, wcml_rounded_price, wcml_currencies_without_cents, wcml_product_custom_prices, wcml_custom_prices_strings, wcml_switch_currency, wcml_custom_prices_fields, wcml_multi_currency_ajax_actions