builders
2 weeks ago
documents
2 weeks ago
builder-content.php
2 weeks ago
class-helper.php
2 weeks ago
class-loader.php
2 weeks ago
class-panel-options.php
2 weeks ago
conditions-file.php
2 weeks ago
conditions-rules.php
2 weeks ago
elementor-document.php
2 weeks ago
theme-builder.php
2 weeks ago
widgets-passing-lists.php
2 weeks ago
class-loader.php
351 lines
| 1 | <?php |
| 2 | namespace EcafeAddons; |
| 3 | |
| 4 | use Elementor\Utils; |
| 5 | use Elementor\Core\Settings\Manager as SettingsManager; |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | exit; // Exit if accessed directly. |
| 9 | } |
| 10 | |
| 11 | final class EcafeElementLoad { |
| 12 | |
| 13 | private static $_instance; |
| 14 | |
| 15 | |
| 16 | private $_modules_manager; |
| 17 | |
| 18 | public static function instance() { |
| 19 | if ( is_null( self::$_instance ) ) { |
| 20 | self::$_instance = new self(); |
| 21 | self::$_instance->init(); |
| 22 | } |
| 23 | return self::$_instance; |
| 24 | } |
| 25 | |
| 26 | public function init() { |
| 27 | include_once ECAFE_CLASSES_URL . 'builder-content.php'; |
| 28 | include_once ECAFE_CLASSES_URL . 'builders/theme-template.php'; |
| 29 | include_once ECAFE_CLASSES_URL . 'conditions-file.php'; |
| 30 | include_once ECAFE_CLASSES_URL . 'theme-builder.php'; |
| 31 | include_once ECAFE_CLASSES_URL . 'elementor-document.php'; |
| 32 | include_once ECAFE_CLASSES_URL . 'conditions-rules.php'; |
| 33 | |
| 34 | register_activation_hook( ECAFE_BASE_NAME, array( __CLASS__, 'activation_hook' ) ); |
| 35 | } |
| 36 | |
| 37 | private function includes() { |
| 38 | |
| 39 | require_once ECAFE_CLASSES_URL . 'class-helper.php'; |
| 40 | |
| 41 | $defaultOnLoad = 'ecafedefaultoptions'; |
| 42 | $value = '1'; |
| 43 | if ( is_admin() && get_option( $defaultOnLoad ) !== false ) { |
| 44 | } elseif ( is_admin() ) { |
| 45 | $defaultLoad = get_option( 'ecafe_widgets' ); |
| 46 | if ( $defaultLoad !== false && $defaultLoad != '' ) { |
| 47 | $defaultNull = null; |
| 48 | $onLoadAuto = 'no'; |
| 49 | add_option( $defaultOnLoad, $value, $defaultNull, $onLoadAuto ); |
| 50 | } else { |
| 51 | $widgetsPage = get_option( 'ecafe_widgets' ); |
| 52 | $widgetsPage['widgetsload'] = array( 'ecafe-accordion', 'ecafe-adv-text-block', 'ecafe-back-to-top', 'ecafe-business-hours', 'ecafe-button','ecafe-calendly', 'ecafe-changelog', 'ecafe-chart','ecafe-circular-image-hover-effect','ecafe-contact-form-7','ecafe-copyright', 'ecafe-count-down', 'ecafe-coupon-code', 'ecafe-creative-gallery','ecafe-creative-title','ecafe-darkmode-styling', 'ecafe-dropcap', 'ecafe-flipbox', 'ecafe-gradient-underline-text','ecafe-gravity-forms','ecafe-grid-post-listing','ecafe-horizontal-page-scroll','ecafe-hover-background','ecafe-infobox', 'ecafe-social-icons', 'ecafe-title', 'ecafe-image-accordion', 'ecafe-image-animated-shape','ecafe-image-hover-effect','ecafe-image-scroll', 'ecafe-infocard', 'ecafe-infocircle', 'ecafe-infoprofile', 'ecafe-infounfold','ecafe-lottie', 'ecafe-manual-comparison-table','ecafe-marketing-link', 'ecafe-marquee','ecafe-marquee-text', 'ecafe-motion-text-circle', 'ecafe-page-piling', 'ecafe-page-scroll-to-id','ecafe-pdf-viewer', 'ecafe-preloader', 'ecafe-qr-code', 'ecafe-scroll-progress','ecafe-service-lists', 'ecafe-sticky-video', 'ecafe-toc', 'ecafe-teammember', 'ecafe-testimonial','ecafe-tabs', 'ecafe-text-background' ); |
| 53 | |
| 54 | $defaultNull = null; |
| 55 | $onLoadAuto = 'no'; |
| 56 | add_option( 'ecafe_widgets', $widgetsPage, $defaultNull, $onLoadAuto ); |
| 57 | add_option( $defaultOnLoad, $value, $defaultNull, $onLoadAuto ); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | require ECAFE_CLASSES_URL . 'class-panel-options.php'; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Carry widgets |
| 66 | */ |
| 67 | public function carryWidgets() { |
| 68 | require_once ECAFE_CLASSES_URL . 'widgets-passing-lists.php'; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Editor load style |
| 73 | */ |
| 74 | public function afterEnqueueStylesEditor() { |
| 75 | wp_enqueue_style( 'ecafe-elementor', ECAFE_ASSETS_PATH . 'css/admin/ecafe-elementor.css', array(), ECAFE_VERSION, false ); |
| 76 | |
| 77 | $ui_theme = SettingsManager::get_settings_managers( 'editorPreferences' )->get_model()->get_settings( 'ui_theme' ); |
| 78 | if ( ! empty( $ui_theme ) && $ui_theme == 'dark' ) { |
| 79 | wp_enqueue_style( 'ecafe-dark-elementor', ECAFE_ASSETS_PATH . 'css/admin/ecafe-dark-elementor.css', array(), ECAFE_VERSION, false ); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Admin load style |
| 85 | */ |
| 86 | public function ecafeElementorAdminCss( $hook ) { |
| 87 | wp_enqueue_style( 'ecafe-elementor', ECAFE_ASSETS_PATH . 'css/admin/ecafe-elementor.css', array(), ECAFE_VERSION, false ); |
| 88 | wp_enqueue_script( 'ecafe-backuser', ECAFE_ASSETS_PATH . 'js/admin/ecafe-admin.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 89 | |
| 90 | if ( ( 'post-new.php' === $hook || 'post.php' === $hook ) && get_post_type() === ECAFE_POST ) { |
| 91 | wp_enqueue_style( 'select2-css', ECAFE_ASSETS_PATH . 'css/admin/select2.min.css', array(), ECAFE_VERSION ); |
| 92 | |
| 93 | wp_enqueue_script( 'select2-js', ECAFE_ASSETS_PATH . 'js/admin/select2.min.js', array( 'jquery' ), ECAFE_VERSION, true ); |
| 94 | |
| 95 | wp_localize_script( |
| 96 | 'ecafe-backuser', |
| 97 | 'ecafe_data', |
| 98 | array( |
| 99 | 'nonce' => wp_create_nonce( 'ecafe-temp-nonce' ), |
| 100 | ) |
| 101 | ); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Category for elementor |
| 107 | */ |
| 108 | public function categoryForElementor() { |
| 109 | $EI = \Elementor\Plugin::$instance; |
| 110 | $EI->elements_manager->add_category( |
| 111 | 'essential', |
| 112 | array( |
| 113 | 'title' => esc_html__( 'EC Essential', 'essential-classy-addons-for-elementor' ), |
| 114 | 'icon' => 'ecaddons', |
| 115 | ), |
| 116 | 1 |
| 117 | ); |
| 118 | $EI->elements_manager->add_category( |
| 119 | 'ecpro', |
| 120 | array( |
| 121 | 'title' => esc_html__( 'EC Pro', 'essential-classy-addons-for-elementor' ), |
| 122 | 'icon' => 'ecaddons', |
| 123 | ), |
| 124 | 1 |
| 125 | ); |
| 126 | $EI->elements_manager->add_category( |
| 127 | 'ecwoocommerce', |
| 128 | array( |
| 129 | 'title' => esc_html__( 'EC WooCommerce', 'essential-classy-addons-for-elementor' ), |
| 130 | 'icon' => 'ecaddons', |
| 131 | ), |
| 132 | 1 |
| 133 | ); |
| 134 | $EI->elements_manager->add_category( |
| 135 | 'ecforms', |
| 136 | array( |
| 137 | 'title' => esc_html__( 'EC Forms', 'essential-classy-addons-for-elementor' ), |
| 138 | 'icon' => 'ecaddons', |
| 139 | ), |
| 140 | 1 |
| 141 | ); |
| 142 | $EI->elements_manager->add_category( |
| 143 | 'ecembed', |
| 144 | array( |
| 145 | 'title' => esc_html__( 'EC Embed', 'essential-classy-addons-for-elementor' ), |
| 146 | 'icon' => 'ecaddons', |
| 147 | ), |
| 148 | 1 |
| 149 | ); |
| 150 | $EI->elements_manager->add_category( |
| 151 | 'ecproschema', |
| 152 | array( |
| 153 | 'title' => esc_html__( 'EC Schema', 'essential-classy-addons-for-elementor' ), |
| 154 | 'icon' => 'ecaddons', |
| 155 | ), |
| 156 | 1 |
| 157 | ); |
| 158 | $EI->elements_manager->add_category( |
| 159 | 'ecacf', |
| 160 | array( |
| 161 | 'title' => esc_html__( 'EC ACF', 'essential-classy-addons-for-elementor' ), |
| 162 | 'icon' => 'ecaddons', |
| 163 | ), |
| 164 | 1 |
| 165 | ); |
| 166 | $EI->elements_manager->add_category( |
| 167 | 'eccfs', |
| 168 | array( |
| 169 | 'title' => esc_html__( 'EC CFS', 'essential-classy-addons-for-elementor' ), |
| 170 | 'icon' => 'ecaddons', |
| 171 | ), |
| 172 | 1 |
| 173 | ); |
| 174 | $EI->elements_manager->add_category( |
| 175 | 'ecjetengine', |
| 176 | array( |
| 177 | 'title' => esc_html__( 'EC JetEngine', 'essential-classy-addons-for-elementor' ), |
| 178 | 'icon' => 'ecaddons', |
| 179 | ), |
| 180 | 1 |
| 181 | ); |
| 182 | $EI->elements_manager->add_category( |
| 183 | 'ecmetabox', |
| 184 | array( |
| 185 | 'title' => esc_html__( 'EC Metabox', 'essential-classy-addons-for-elementor' ), |
| 186 | 'icon' => 'ecaddons', |
| 187 | ), |
| 188 | 1 |
| 189 | ); |
| 190 | $EI->elements_manager->add_category( |
| 191 | 'ecpods', |
| 192 | array( |
| 193 | 'title' => esc_html__( 'EC Pods', 'essential-classy-addons-for-elementor' ), |
| 194 | 'icon' => 'ecaddons', |
| 195 | ), |
| 196 | 1 |
| 197 | ); |
| 198 | $EI->elements_manager->add_category( |
| 199 | 'ectoolset', |
| 200 | array( |
| 201 | 'title' => esc_html__( 'EC Toolset', 'essential-classy-addons-for-elementor' ), |
| 202 | 'icon' => 'ecaddons', |
| 203 | ), |
| 204 | 1 |
| 205 | ); |
| 206 | $EI->elements_manager->add_category( |
| 207 | 'ecwck', |
| 208 | array( |
| 209 | 'title' => esc_html__( 'EC WCK', 'essential-classy-addons-for-elementor' ), |
| 210 | 'icon' => 'ecaddons', |
| 211 | ), |
| 212 | 1 |
| 213 | ); |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Settings links |
| 218 | */ |
| 219 | function ecafeSettingsLinks( $settingsLinks ) { |
| 220 | $settingsLinksArray = array( |
| 221 | '<a href="' . admin_url( 'admin.php?page=ecafe_widgets' ) . '">' . esc_html__( 'Settings', 'essential-classy-addons-for-elementor' ) . '</a>', |
| 222 | ); |
| 223 | return array_merge( $settingsLinks, $settingsLinksArray ); |
| 224 | } |
| 225 | |
| 226 | function ecafeSettingsLinksRest( $settingsLinks ) { |
| 227 | if ( defined( 'ECAFEP_VERSION' ) ) { |
| 228 | $get_values = unserialize( get_option( 'ecafewhitelabel' ) ); |
| 229 | if ( ! empty( $get_values['plugin_name_free'] ) ) { |
| 230 | $settingsLinksArray = array(); |
| 231 | } else { |
| 232 | $settingsLinksArray = array( |
| 233 | ' | <a href="https://www.facebook.com/groups/340597333894907" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Join/Contact US', 'essential-classy-addons-for-elementor' ) . '</a> | <a href="https://ecaddons.com/docs/" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Document', 'essential-classy-addons-for-elementor' ) . '</a> | <a href="http://store.kapasias.com/helpdesk/" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Support', 'essential-classy-addons-for-elementor' ) . '</a>', |
| 234 | ); |
| 235 | } |
| 236 | } else { |
| 237 | $settingsLinksArray = array( |
| 238 | ' | <a href="https://www.facebook.com/groups/340597333894907" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Join/Contact US', 'essential-classy-addons-for-elementor' ) . '</a> | <a href="https://ecaddons.com/docs/" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Document', 'essential-classy-addons-for-elementor' ) . '</a> | <a href="http://store.kapasias.com/helpdesk/" target="_blank" style="color:#000; font-weight: bold;">' . __( 'Support', 'essential-classy-addons-for-elementor' ) . '</a>', |
| 239 | ); |
| 240 | } |
| 241 | |
| 242 | return array_merge( $settingsLinks, $settingsLinksArray ); |
| 243 | } |
| 244 | |
| 245 | public function ecafeEnqueueStyles() { |
| 246 | wp_enqueue_style( 'ecafe-frontend-css', ECAFE_ASSETS_PATH . 'css/custom/ecafe-front.min.css', array(), ECAFE_VERSION ); |
| 247 | // wp_enqueue_style('ecafe-lightbox',ECAFE_ASSETS_PATH . 'css/baharni/lightbox.css',[],ECAFE_VERSION); |
| 248 | |
| 249 | wp_enqueue_style( 'font-awesome-5-all', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css', array(), ECAFE_VERSION ); |
| 250 | |
| 251 | if ( isset( $_GET['elementor-preview'] ) && (int) $_GET['elementor-preview'] ) { |
| 252 | wp_register_script( 'ecafe-tilt-js-3rd', ECAFE_ASSETS_PATH . 'js/baharni/tilt.jquery.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 253 | wp_register_script( 'ecafe-tilt-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tilt-custom.min.js', array( 'ecafe-tilt-js-3rd' ), ECAFE_VERSION, false ); |
| 254 | wp_enqueue_script( 'ecafe-tilt-js' ); |
| 255 | |
| 256 | wp_enqueue_style( 'ecafe-tippy-css', ECAFE_ASSETS_PATH . 'css/baharni/tippy.min.css', array(), ECAFE_VERSION, false ); |
| 257 | wp_register_script( 'ecafe-popper-js', ECAFE_ASSETS_PATH . 'js/baharni/popper.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 258 | wp_register_script( 'ecafe-tippy-js-3rd', ECAFE_ASSETS_PATH . 'js/baharni/tippy-bundle.umd.min.js', array( 'ecafe-popper-js' ), ECAFE_VERSION, false ); |
| 259 | wp_register_script( 'ecafe-tippy-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tippy-custom.min.js', array( 'ecafe-popper-js', 'ecafe-tippy-js-3rd' ), ECAFE_VERSION, false ); |
| 260 | wp_enqueue_script( 'ecafe-tippy-js' ); |
| 261 | } |
| 262 | |
| 263 | wp_register_script( 'ecafe-accordion', ECAFE_ASSETS_PATH . 'js/custom/ecafe-accordion.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 264 | wp_register_script( 'ecafe-back-to-top', ECAFE_ASSETS_PATH . 'js/custom/ecafe-back-to-top.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 265 | wp_register_script( 'ecafe-chart-3rd', ECAFE_ASSETS_PATH . 'js/baharni/chart.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 266 | wp_register_script( 'ecafe-chart', ECAFE_ASSETS_PATH . 'js/custom/ecafe-chart.min.js', array( 'ecafe-chart-3rd' ), ECAFE_VERSION, false ); |
| 267 | wp_register_script( 'ecafe-calendly-3rd', ECAFE_ASSETS_PATH . 'js/baharni/calendlywidget.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 268 | wp_register_script( 'ecafe-changelog', ECAFE_ASSETS_PATH . 'js/custom/ecafe-changelog.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 269 | // wp_register_script('ecafe-lightbox', ECAFE_ASSETS_PATH . 'js/baharni/lightbox.js', array('jquery'),ECAFE_VERSION,false ); |
| 270 | wp_register_script( 'ecafe-infounfold', ECAFE_ASSETS_PATH . 'js/custom/ecafe-infounfold.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 271 | wp_register_script( 'ecafe-marquee', ECAFE_ASSETS_PATH . 'js/custom/ecafe-marquee.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 272 | wp_register_script( 'ecafe-lax', ECAFE_ASSETS_PATH . 'js/baharni/lax.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 273 | wp_register_script( 'ecafe-min-js', ECAFE_ASSETS_PATH . 'js/custom/ecafe.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 274 | wp_register_script( 'ecafe-isotope', ECAFE_ASSETS_PATH . 'js/baharni/isotope.pkgd.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 275 | wp_register_script( 'ecafe-imagesloaded', ECAFE_ASSETS_PATH . 'js/baharni/imagesloaded.pkgd.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 276 | wp_register_script( 'ecafe-post-listing', ECAFE_ASSETS_PATH . 'js/custom/ecafe-post-listing.min.js', array( 'ecafe-isotope', 'ecafe-imagesloaded' ), ECAFE_VERSION, false ); |
| 277 | wp_register_script( 'ecafe-tabs', ECAFE_ASSETS_PATH . 'js/custom/ecafe-tabs.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 278 | wp_register_script( 'ecafe-whatsapp', ECAFE_ASSETS_PATH . 'js/custom/ecafe-whatsapp.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 279 | wp_register_script( 'ecafe-countdown', ECAFE_ASSETS_PATH . 'js/custom/ecafe-countdown.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 280 | wp_register_script( 'ecafe-coupon-code', ECAFE_ASSETS_PATH . 'js/custom/ecafe-coupon-code.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 281 | wp_register_script( 'ecafe-lottie-3rd', ECAFE_ASSETS_PATH . 'js/baharni/lottie.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 282 | wp_register_script( 'ecafe-lottie', ECAFE_ASSETS_PATH . 'js/custom/ecafe-lottie.min.js', array( 'ecafe-lottie-3rd' ), ECAFE_VERSION, false ); |
| 283 | wp_register_script( 'ecafe-marketing-link', ECAFE_ASSETS_PATH . 'js/custom/ecafe-marketing-link.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 284 | wp_register_script( 'ecafe-scroll-progress', ECAFE_ASSETS_PATH . 'js/custom/ecafe-scroll-progress.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 285 | wp_register_script( 'ecafe-image-scroll', ECAFE_ASSETS_PATH . 'js/custom/ecafe-image-scroll.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 286 | wp_register_script( 'ecafe-image-accordion', ECAFE_ASSETS_PATH . 'js/custom/ecafe-image-accordion.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 287 | wp_register_script( 'ecafe-horizontal-page-scroll', ECAFE_ASSETS_PATH . 'js/custom/ecafe-horizontal-page-scroll.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 288 | wp_register_script( 'ecafe-hover-background', ECAFE_ASSETS_PATH . 'js/custom/ecafe-hover-background.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 289 | wp_register_script( 'ecafe-post-image', ECAFE_ASSETS_PATH . 'js/custom/ecafe-post-image.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 290 | wp_register_script( 'ecafe-page-piling-3rd', ECAFE_ASSETS_PATH . 'js/baharni/pagepiling.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 291 | wp_register_script( 'ecafe-page-piling', ECAFE_ASSETS_PATH . 'js/custom/ecafe-page-piling.min.js', array( 'ecafe-page-piling-3rd' ), ECAFE_VERSION, false ); |
| 292 | wp_register_script( 'ecafe-page-scroll-to-id-3rd', ECAFE_ASSETS_PATH . 'js/baharni/jquery.PageScroll2id.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 293 | wp_register_script( 'ecafe-page-scroll-to-id', ECAFE_ASSETS_PATH . 'js/custom/ecafe-page-scroll-to-id.min.js', array( 'ecafe-page-scroll-to-id-3rd' ), ECAFE_VERSION, false ); |
| 294 | wp_register_script( 'ecafe-pdf-viewer-3rd', ECAFE_ASSETS_PATH . 'js/baharni/pdfobject.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 295 | wp_register_script( 'ecafe-pdf-viewer', ECAFE_ASSETS_PATH . 'js/custom/ecafe-pdf-viewer.min.js', array( 'ecafe-pdf-viewer-3rd' ), ECAFE_VERSION, false ); |
| 296 | wp_register_script( 'ecafe-tocbot-3rd', ECAFE_ASSETS_PATH . 'js/baharni/tocbot.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 297 | wp_register_script( 'ecafe-toc', ECAFE_ASSETS_PATH . 'js/custom/ecafe-toc.min.js', array( 'ecafe-tocbot-3rd' ), ECAFE_VERSION, false ); |
| 298 | wp_register_script( 'ecafe-qrcode-3rd', ECAFE_ASSETS_PATH . 'js/baharni/jquery.qrcode.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 299 | wp_register_script( 'ecafe-qrcode', ECAFE_ASSETS_PATH . 'js/custom/ecafe-qrcode.min.js', array( 'ecafe-qrcode-3rd' ), ECAFE_VERSION, false ); |
| 300 | wp_register_script( 'ecafe-infocircle', ECAFE_ASSETS_PATH . 'js/custom/ecafe-infocircle.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 301 | wp_register_script( 'ecafe-sticky-video', ECAFE_ASSETS_PATH . 'js/custom/ecafe-sticky-video.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 302 | wp_register_script( 'ec-confettieffect-3rd', ECAFE_ASSETS_PATH . 'js/baharni/js-confetti.browser.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 303 | wp_register_script( 'ec-confettieffect', ECAFE_ASSETS_PATH . 'js/custom/ec-confettieffect.min.js', array( 'ec-confettieffect-3rd' ), ECAFE_VERSION, false ); |
| 304 | wp_register_script( 'ecafe-event-tracker', ECAFE_ASSETS_PATH . 'js/custom/ecafe-event-tracker.min.js', array( 'jquery' ), ECAFE_VERSION, false ); |
| 305 | |
| 306 | wp_localize_script( |
| 307 | 'jquery', |
| 308 | 'ecafe_data', |
| 309 | array( |
| 310 | 'eca_ajax_url' => admin_url( 'admin-ajax.php' ), |
| 311 | ) |
| 312 | ); |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Hooks |
| 317 | */ |
| 318 | private function hooks() { |
| 319 | add_action( 'elementor/elements/categories_registered', array( $this, 'categoryForElementor' ) ); |
| 320 | |
| 321 | // Register Widget Styles & Script |
| 322 | if ( did_action( 'elementor/loaded' ) ) { |
| 323 | add_action( 'wp_enqueue_scripts', array( $this, 'ecafeEnqueueStyles' ) ); |
| 324 | } |
| 325 | |
| 326 | add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'afterEnqueueStylesEditor' ) ); |
| 327 | add_action( 'admin_enqueue_scripts', array( $this, 'ecafeElementorAdminCss' ) ); |
| 328 | add_filter( 'plugin_action_links_' . ECAFE_BASE_NAME, array( $this, 'ecafeSettingsLinks' ) ); |
| 329 | add_filter( 'plugin_action_links_' . ECAFE_BASE_NAME, array( $this, 'ecafeSettingsLinksRest' ) ); |
| 330 | } |
| 331 | |
| 332 | /** |
| 333 | * Activation Hook |
| 334 | */ |
| 335 | public static function activation_hook( $network_wide ) { |
| 336 | flush_rewrite_rules(); |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * Constructor |
| 341 | */ |
| 342 | private function __construct() { |
| 343 | $this->includes(); |
| 344 | $this->hooks(); |
| 345 | $this->carryWidgets(); |
| 346 | ecafeWidgetsPassed(); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | EcafeElementLoad::instance(); |
| 351 |