MulticurrencyHooks.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\WpFastestCache; |
| 4 | |
| 5 | class MulticurrencyHooks implements \IWPML_Action { |
| 6 | |
| 7 | public function add_hooks() { |
| 8 | add_filter( |
| 9 | 'wcml_is_cache_enabled_for_switching_currency', |
| 10 | [ |
| 11 | $this, |
| 12 | 'is_cache_enabled_for_switching_currency', |
| 13 | ] |
| 14 | ); |
| 15 | } |
| 16 | |
| 17 | public function is_cache_enabled_for_switching_currency( $cache_enabled ) { |
| 18 | |
| 19 | $wp_fastest_cache_options = json_decode( get_option( 'WpFastestCache' ) ); |
| 20 | |
| 21 | if ( isset( $wp_fastest_cache_options->wpFastestCacheStatus ) && 'on' === $wp_fastest_cache_options->wpFastestCacheStatus ) { |
| 22 | $cache_enabled = true; |
| 23 | } |
| 24 | |
| 25 | return $cache_enabled; |
| 26 | } |
| 27 | |
| 28 | } |
| 29 | |
| 30 |