PluginProbe ʕ •ᴥ•ʔ
LiteSpeed Cache / 7.0.1
LiteSpeed Cache v7.0.1
trunk 1.0.15 1.9.1.1 2.9.9.2 3.6.4 4.6 5.7.0.1 6.5.4 7.0.0.1 7.0.1 7.1 7.2 7.3 7.3.0.1 7.4 7.5 7.5.0.1 7.6 7.6.1 7.6.2 7.7 7.8 7.8.0.1 7.8.1
litespeed-cache / thirdparty / wcml.cls.php
litespeed-cache / thirdparty Last commit date
aelia-currencyswitcher.cls.php 1 year ago amp.cls.php 1 year ago autoptimize.cls.php 1 year ago avada.cls.php 1 year ago bbpress.cls.php 1 year ago beaver-builder.cls.php 1 year ago caldera-forms.cls.php 1 year ago divi-theme-builder.cls.php 1 year ago elementor.cls.php 1 year ago entry.inc.php 1 year ago facetwp.cls.php 1 year ago gravity-forms.cls.php 1 year ago litespeed-check.cls.php 1 year ago nextgengallery.cls.php 1 year ago perfmatters.cls.php 1 year ago theme-my-login.cls.php 1 year ago user-switching.cls.php 1 year ago wc-pdf-product-vouchers.cls.php 1 year ago wcml.cls.php 1 year ago woo-paypal.cls.php 1 year ago woocommerce.cls.php 1 year ago woocommerce.content.tpl.php 1 year ago woocommerce.tab.tpl.php 1 year ago wp-polls.cls.php 1 year ago wp-postratings.cls.php 1 year ago wpdiscuz.cls.php 1 year ago wplister.cls.php 1 year ago wpml.cls.php 1 year ago wptouch.cls.php 1 year ago yith-wishlist.cls.php 1 year ago
wcml.cls.php
48 lines
1 <?php
2 /**
3 * The Third Party integration with WCML.
4 *
5 * @since 3.0
6 */
7 namespace LiteSpeed\Thirdparty;
8
9 defined('WPINC') || exit();
10
11 class WCML
12 {
13 private static $_currency = '';
14
15 public static function detect()
16 {
17 if (!defined('WCML_VERSION')) {
18 return;
19 }
20
21 add_filter('wcml_client_currency', __CLASS__ . '::apply_client_currency');
22 add_action('wcml_set_client_currency', __CLASS__ . '::set_client_currency');
23 }
24
25 public static function set_client_currency($currency)
26 {
27 self::apply_client_currency($currency);
28
29 do_action('litespeed_vary_ajax_force');
30 }
31
32 public static function apply_client_currency($currency)
33 {
34 if ($currency !== wcml_get_woocommerce_currency_option()) {
35 self::$_currency = $currency;
36 add_filter('litespeed_vary', __CLASS__ . '::apply_vary');
37 }
38
39 return $currency;
40 }
41
42 public static function apply_vary($list)
43 {
44 $list['wcml_currency'] = self::$_currency;
45 return $list;
46 }
47 }
48