PluginProbe
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 4.7.3
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v4.7.3
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 All 85 releases
shopengine / trunk / widgets / init / enqueue-scripts.php
enqueue-scripts.php
52 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ShopEngine\Widgets\Init;
4
5 defined('ABSPATH') || exit;
6
7 class Enqueue_Scripts
8 {
9
10 public function __construct() {
11
12 add_action('wp_enqueue_scripts', [$this, 'frontend_js']);
13 add_action('wp_enqueue_scripts', [$this, 'frontend_css'], 8);
14 add_action('elementor/editor/before_enqueue_scripts', [$this, 'editor_js']);
15 add_action('elementor/frontend/before_enqueue_scripts', [$this, 'elementor_js']);
16 add_action('elementor/editor/after_enqueue_styles', [$this, 'elementor_css']);
17 }
18
19 public function editor_js(){
20 if(get_post_type() != 'shopengine-template'){
21 return;
22 }
23
24 wp_enqueue_script('shopengine-editor-script', \ShopEngine::widget_url() . 'init/assets/js/editor.js', ['jquery', 'elementor-editor'], \ShopEngine::version(), true);
25 }
26
27 public function elementor_js() {
28 // Font Awesome fallback support on Editor Mode.
29 if ( defined( 'ELEMENTOR_ASSETS_URL' ) && \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
30 wp_enqueue_style( 'editor-font-awesome', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.css', [], \ShopEngine::version() );
31 }
32
33
34 wp_enqueue_script('shopengine-elementor-script', \ShopEngine::widget_url() . 'init/assets/js/widgets.js', ['jquery', 'elementor-frontend'], \ShopEngine::version(), true);
35 }
36
37 public function elementor_css() {
38 wp_enqueue_style('shopengine-elementor-style', \ShopEngine::widget_url() . 'init/assets/css/widgets.css', null , \ShopEngine::version());
39 }
40
41 public function frontend_js() {
42 wp_register_script('asrange-js', \ShopEngine::widget_url() . 'init/assets/js/jquery-asRange.min.js', [], \ShopEngine::version(), true);
43 }
44
45 public function frontend_css() {
46 wp_enqueue_style('shopengine-widget-frontend', \ShopEngine::widget_url() . 'init/assets/css/widget-frontend.css', ['shopengine-public'], \ShopEngine::version());
47 if ( defined( 'ELEMENTOR_ASSETS_URL' ) ){
48 wp_enqueue_style( 'shopengine-frontend-font-awesome', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.css', [], \ShopEngine::version() );
49 }
50 }
51 }
52