← All changes
|
vendor/codeinwp/themeisle-sdk/src/Modules/Script_loader.php
+5
-8
3.10.15
→
3.10.8
View file →
| @@ -30,8 +30,12 @@ | ||
| 30 | 30 | * |
| 31 | 31 | * @return bool Should we load ? |
| 32 | 32 | */ |
| 33 | 33 | public function can_load( $product ) { |
| 34 | + if ( apply_filters( 'themeisle_sdk_ran_promos', false ) === true ) { | |
| 35 | + return false; | |
| 36 | + } | |
| 37 | + | |
| 34 | 38 | if ( $this->is_from_partner( $product ) ) { |
| 35 | 39 | return false; |
| 36 | 40 | } |
| 37 | 41 | |
| @@ -51,20 +55,13 @@ | ||
| 51 | 55 | return $this; |
| 52 | 56 | } |
| 53 | 57 | |
| 54 | 58 | /** |
| 55 | - * Setup actions. Once for all products. | |
| 59 | + * Setup actions. | |
| 56 | 60 | */ |
| 57 | 61 | private function setup_actions() { |
| 58 | - | |
| 59 | - if ( apply_filters( 'themeisle_sdk_script_setup', false ) ) { | |
| 60 | - return; | |
| 61 | - } | |
| 62 | - | |
| 63 | 62 | add_filter( 'themeisle_sdk_dependency_script_handler', [ $this, 'get_script_handler' ], 10, 1 ); |
| 64 | 63 | add_action( 'themeisle_sdk_dependency_enqueue_script', [ $this, 'enqueue_script' ], 10, 1 ); |
| 65 | - | |
| 66 | - add_filter( 'themeisle_sdk_script_setup', '__return_true' ); | |
| 67 | 64 | } |
| 68 | 65 | |
| 69 | 66 | /** |
| 70 | 67 | * Get the script handler. |