| @@ -26,10 +26,10 @@ | ||
| 26 | 26 | * @since 5.0.0 |
| 27 | 27 | */ |
| 28 | 28 | public function __construct( $data = [], $args = null ) { |
| 29 | 29 | parent::__construct( $data, $args ); |
| 30 | - // Core. | |
| 31 | - wp_enqueue_style( | |
| 30 | + // Register assets; Elementor enqueues via get_*_depends() when used. | |
| 31 | + wp_register_style( | |
| 32 | 32 | 'ctc-blocks-core', |
| 33 | 33 | CTC_URI . 'includes/assets/css/style.css', |
| 34 | 34 | [], |
| 35 | 35 | CTC_VER, |
| @@ -34,9 +34,9 @@ | ||
| 34 | 34 | [], |
| 35 | 35 | CTC_VER, |
| 36 | 36 | 'all' |
| 37 | 37 | ); |
| 38 | - wp_enqueue_script( | |
| 38 | + wp_register_script( | |
| 39 | 39 | 'ctc-lib-core', |
| 40 | 40 | CTC_URI . 'assets/frontend/js/lib/ctc.js', |
| 41 | 41 | ['jquery'], |
| 42 | 42 | CTC_VER, |
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | ['jquery'], |
| 42 | 42 | CTC_VER, |
| 43 | 43 | true |
| 44 | 44 | ); |
| 45 | - wp_enqueue_script( | |
| 45 | + wp_register_script( | |
| 46 | 46 | 'ctc-blocks-core', |
| 47 | 47 | CTC_URI . 'includes/assets/js/core.js', |
| 48 | 48 | ['ctc-lib-core'], |
| 49 | 49 | CTC_VER, |
| @@ -48,10 +48,9 @@ | ||
| 48 | 48 | ['ctc-lib-core'], |
| 49 | 49 | CTC_VER, |
| 50 | 50 | true |
| 51 | 51 | ); |
| 52 | - // Block. | |
| 53 | - wp_enqueue_style( | |
| 52 | + wp_register_style( | |
| 54 | 53 | 'ctc-el-email-sample', |
| 55 | 54 | CTC_URI . 'includes/elementor/widgets/email-sample/style.css', |
| 56 | 55 | ['ctc-blocks-core'], |
| 57 | 56 | CTC_VER, |
| @@ -62,9 +61,9 @@ | ||
| 62 | 61 | /** |
| 63 | 62 | * Get script dependencies |
| 64 | 63 | */ |
| 65 | 64 | public function get_script_depends() { |
| 66 | - return ['ctc-el-email-sample']; | |
| 65 | + return ['ctc-lib-core', 'ctc-blocks-core']; | |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | 68 | /** |
| 70 | 69 | * Get style dependencies |
| @@ -69,9 +68,9 @@ | ||
| 69 | 68 | /** |
| 70 | 69 | * Get style dependencies |
| 71 | 70 | */ |
| 72 | 71 | public function get_style_depends() { |
| 73 | - return ['ctc-blocks-core']; | |
| 72 | + return ['ctc-el-email-sample']; | |
| 74 | 73 | } |
| 75 | 74 | |
| 76 | 75 | /** |
| 77 | 76 | * Get name |