← All changes
|
includes/elementor/widgets/email-address/widget.php
+12
-6
5.5.3
→
5.5.4
View file →
| @@ -18,10 +18,10 @@ | ||
| 18 | 18 | */ |
| 19 | 19 | class Address extends Widget_Base { |
| 20 | 20 | public function __construct( $data = [], $args = null ) { |
| 21 | 21 | parent::__construct( $data, $args ); |
| 22 | - // Core. | |
| 23 | - wp_enqueue_style( | |
| 22 | + // Register assets; Elementor enqueues via get_*_depends() when used. | |
| 23 | + wp_register_style( | |
| 24 | 24 | 'ctc-blocks', |
| 25 | 25 | CTC_URI . 'includes/assets/css/style.css', |
| 26 | 26 | [], |
| 27 | 27 | CTC_VER, |
| @@ -26,9 +26,9 @@ | ||
| 26 | 26 | [], |
| 27 | 27 | CTC_VER, |
| 28 | 28 | 'all' |
| 29 | 29 | ); |
| 30 | - wp_enqueue_script( | |
| 30 | + wp_register_script( | |
| 31 | 31 | 'ctc-lib-core', |
| 32 | 32 | CTC_URI . 'assets/frontend/js/lib/ctc.js', |
| 33 | 33 | ['jquery'], |
| 34 | 34 | CTC_VER, |
| @@ -33,10 +33,16 @@ | ||
| 33 | 33 | ['jquery'], |
| 34 | 34 | CTC_VER, |
| 35 | 35 | true |
| 36 | 36 | ); |
| 37 | - // Block. | |
| 38 | - wp_enqueue_style( | |
| 37 | + wp_register_script( | |
| 38 | + 'ctc-blocks-core', | |
| 39 | + CTC_URI . 'includes/assets/js/core.js', | |
| 40 | + ['ctc-lib-core'], | |
| 41 | + CTC_VER, | |
| 42 | + true | |
| 43 | + ); | |
| 44 | + wp_register_style( | |
| 39 | 45 | 'ctc-el-email-address', |
| 40 | 46 | CTC_URI . 'includes/elementor/widgets/email-address/style.css', |
| 41 | 47 | ['ctc-blocks'], |
| 42 | 48 | CTC_VER, |
| @@ -44,9 +50,9 @@ | ||
| 44 | 50 | ); |
| 45 | 51 | } |
| 46 | 52 | |
| 47 | 53 | public function get_script_depends() { |
| 48 | - return ['ctc-el-email-address']; | |
| 54 | + return ['ctc-lib-core', 'ctc-blocks-core']; | |
| 49 | 55 | } |
| 50 | 56 | |
| 51 | 57 | public function get_style_depends() { |
| 52 | 58 | return ['ctc-el-email-address']; |