assets_url = EASYELEMENTS_DIR_URL . 'includes/Template_Library/assets/'; // get current module's url. $this->rest_url = self::SITE_URL . '/wp-json/rtTemplates/v1/templates'; // print variables on footer. add_action( 'elementor/editor/footer', array( $this, 'easy_editor_footer_script' ) ); // enqueue editor js for elementor. add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'easy_editor_scripts' ), 1 ); // enqueue editor css. add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'easy_editor_styles' ) ); // enqueue modal's preview css. add_action( 'elementor/preview/enqueue_styles', array( $this, 'easy_preview_styles' ) ); } /** * Get instance */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } public function easy_editor_scripts() { wp_enqueue_script( 'easy-elements-template-library-script', $this->assets_url . 'js/easy-template-library.js', array( 'jquery', 'wp-element' ), EASYELEMENTS_VER, true ); wp_localize_script('easy-elements-template-library-script', 'rtElementsTemplatesajax', [ 'previewBaseUrl' => "https://wpeasyelements.com/demotemplate/", 'ajaxUrl' => admin_url('admin-ajax.php'), ]); wp_enqueue_script( 'easy-elements-template-library-isotope-script', $this->assets_url . 'js/isotope.pkgd.min.js', array( 'jquery', 'wp-element' ), EASYELEMENTS_VER, true ); } public function easy_editor_styles() { wp_enqueue_style( 'easy-elements-template-library-style', $this->assets_url . 'css/easy-elements-template-library.min.css', array(), EASYELEMENTS_VER ); } public function easy_preview_styles() { wp_enqueue_style( 'easy-elements-template-library-preview-style', $this->assets_url . 'css/preview.css', array(), EASYELEMENTS_VER ); } public function easy_editor_footer_script() { $license_status = 'invalid'; $pro_version = easyel_get_pro_clean_version(); if ( $pro_version && version_compare( $pro_version, '1.0.8', '>=' ) ) { if ( did_action( 'plugins_loaded' ) && class_exists( '\EasyElements_Elementor\Pro\Licenses\EasyelLicense' ) ) { $manager = \EasyElements_Elementor\Pro\Licenses\EasyelLicense::get_instance(); if ( method_exists( $manager, 'check_license_validity' ) ) { $license_status = $manager->check_license_validity(); } } } else { if ( did_action( 'plugins_loaded' ) && class_exists( '\Easyel_License_Manager' ) ) { $license_manager = new \Easyel_License_Manager(); if ( $license_manager && method_exists( $license_manager, 'check_license_validity' ) ) { $license_status = $license_manager->check_license_validity(); } } } $is_pro = class_exists('Easy_Elements_Pro'); $license_page_url = admin_url('admin.php?page=easy-elements-dashboard#activate_license'); ?>