PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.4.0
Easy Elements for Elementor – Addons & Website Templates v1.4.0
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / base.php

base.php in Easy Elements for Elementor – Addons & Website Templates 1.4.0, at base.php

668 lines 22.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 final class Easyel_Elements_Elementor_Extension {
7
8 const VERSION = EASYELEMENTS_VER;
9
10 private static $_instance = null;
11
12 public static function instance() {
13 if ( is_null( self::$_instance ) ) {
14 self::$_instance = new self();
15 }
16 return self::$_instance;
17 }
18
19 public function __construct() {
20
21 // Load AJAX handlers
22 require_once EASYELEMENTS_DIR_PATH . 'widgets/login-register/class.login-register.php';
23
24 add_action( 'init', [ $this, 'init' ] );
25 add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] );
26 add_action( 'elementor/elements/categories_registered', [ $this, 'add_elementor_categories' ] );
27
28 add_action( 'admin_notices', [ $this, 'easyel_admin_promo_notice' ] , 0 );
29 add_action( 'admin_init', [ $this, 'easyel_admin_promo_notice_dismiss_handler' ] );
30
31 add_filter( 'plugin_row_meta', [ $this, 'easyel_plugin_row_meta' ], 10, 2 );
32
33 add_filter('plugin_action_links_'.EASYELEMENTS_PATH,[ $this,'easyel_setting_page_link' ] );
34
35 add_action( 'plugins_loaded', [ $this, "easyel_plugin_loaded" ] );
36
37 register_activation_hook( EASYELEMENTS_PATH, [ __CLASS__, 'easy_elements_activate' ] );
38
39 add_action( 'admin_init', [ __CLASS__, 'easyel_maybe_upgrade' ] );
40
41 add_action('elementor/controls/register', function( $controls_manager ) {
42 $controls_manager->register(
43 new \Easyel\EasyElements\Utils\SearchSelect2()
44 );
45 });
46
47 \Easyel\EasyElements\Extensions\WrapperLink\EasyelWrapperLink::get_instance();
48
49 }
50
51 public static function easyel_maybe_upgrade() {
52
53 $stored_version = get_option( 'easyel_plugin_version', '0' );
54
55 if ( version_compare( $stored_version, '1.3.1', '<' ) ) {
56
57 self::easyel_upgrade_130();
58
59 update_option( 'easyel_plugin_version', '1.3.1' );
60 }
61 }
62
63 private static function easyel_upgrade_130() {
64
65 $option_key_extension = 'easy_element_extensions';
66 $settings = get_option( $option_key_extension, [] );
67
68 $new_defaults = [
69 'enable_wrapper_link' => 1,
70 'enable_post_duplicator' => 1,
71 'enable_dynamic_content' => 1,
72 'enable_megamenu_builder' => 1,
73 ];
74
75 foreach ( $new_defaults as $key => $default ) {
76 if ( ! isset( $settings[ $key ] ) ) {
77 $settings[ $key ] = $default;
78 }
79 }
80
81 update_option( $option_key_extension, $settings );
82 }
83
84 public static function easy_elements_activate() {
85
86 if ( class_exists( '\Easyel\EasyElements\Admin\Admin_Settings' ) ) {
87
88 $option_key_extension = 'easy_element_extensions';
89 $settings = get_option( $option_key_extension, [] );
90
91 $include_extension = array(
92 "enable_wrapper_link",
93 "enable_post_duplicator",
94 "enable_dynamic_content",
95 "enable_megamenu_builder",
96 );
97
98 $fields2 = [];
99
100 if ( function_exists('easyel_get_extension_fields') ) {
101 $fields2 = easyel_get_extension_fields();
102 }
103
104 foreach ( $fields2 as $key => $data ) {
105
106 if ( array_key_exists( $key, $settings ) ) {
107 continue;
108 }
109
110 $settings[$key] = in_array( $key, $include_extension, true ) ? 1 : 0;
111 }
112
113 update_option( $option_key_extension, $settings );
114
115 $include_widget = array(
116 "easy_table",
117 "bmi_calculator",
118 "single_navigation_menu",
119 );
120
121 $available_elements = \Easyel\EasyElements\Admin\Admin_Settings::get_instance()->easyel_elements_get_available_widgets();
122 $tab = 'widget';
123
124 foreach ( $available_elements as $key => $widget ) {
125
126 if ( isset( $widget['tab'] ) && $widget['tab'] === $tab ) {
127
128 $option_name = 'easy_element_' . $tab . '_' . $key;
129
130 $existing_value = get_option( $option_name, null );
131
132 if ( $existing_value !== null ) {
133 continue;
134 }
135
136 if ( in_array( $key, $include_widget, true ) ) {
137 add_option( $option_name, '0' );
138 }
139 }
140 }
141 }
142
143 flush_rewrite_rules();
144 }
145
146 public function easyel_admin_promo_notice() {
147
148 // Already dismissed
149 if ( get_option( 'easyel_admin_promo_notice_dismissed2' ) ) {
150 return;
151 }
152
153 $dismiss_url = wp_nonce_url(
154 add_query_arg(
155 [ 'easyel_promo_notice_dismiss' => '1' ],
156 admin_url()
157 ),
158 'easyel_promo_notice_dismiss_nonce'
159 );
160 ?>
161
162 <div class="notice notice-info easyel-promo-notice">
163 <div class="easyel-promo-content">
164 <div class="easyel-promo-left">
165 <span class="orange">Exclusive Deals Available</span> <span></span> Discount Up To
166 <span style="color:#ff7dcb;">65%</span> OFF
167 <a class="easyel-promo-btn" href="https://wpeasyelements.com/pricing/" target="_blank">
168 Grab the Deal
169 </a>
170
171 </div>
172 <div class="easyel-promo-right">
173 <a href="<?php echo esc_url( $dismiss_url ); ?>" style="text-decoration:none;">
174 Dismiss
175 </a>
176 </div>
177 </div>
178 </div>
179
180 <?php
181 }
182
183 function easyel_plugin_row_meta( $meta, $plugin_file ) {
184 if ( basename( EASYELEMENTS_PATH) !== basename( $plugin_file ) ) {
185 return $meta;
186 }
187
188 $meta[] = '<a href="https://wpeasyelements.com/docs/" target="_blank">' . esc_html__('Documentation', 'easy-elements' ) . '</a>';
189 $meta[] = '<a href="https://themewant.com/support/" target="_blank">' . esc_html__('Support', 'easy-elements') . '</a>';
190 if ( !file_exists( WP_PLUGIN_DIR . '/' . 'easy-elements-pro/easy-elements-pro.php' ) ) {
191 $meta[] = '<a href="https://wpeasyelements.com/" style="color:#ff7a00; font-weight: bold;" target="_blank">' . esc_html__('Upgrade to Pro', 'easy-elements') . '</a>';
192 }
193 $meta[] = '<a href="https://wordpress.org/support/plugin/easy-elements/reviews/#new-post" target="_blank">' . esc_html__(' Rate the plugin �
194
195
196
197
198 ', 'easy-elements' ) . '</a>';
199 return $meta;
200 }
201
202 public function easyel_admin_promo_notice_dismiss_handler() {
203
204 if ( ! is_admin() ) {
205 return;
206 }
207
208 if ( empty( $_GET['easyel_promo_notice_dismiss'] ) ) {
209 return;
210 }
211
212 $nonce = isset( $_GET['_wpnonce'] )
213 ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) )
214 : '';
215
216 if ( ! wp_verify_nonce( $nonce, 'easyel_promo_notice_dismiss_nonce' ) ) {
217 return;
218 }
219
220 update_option( 'easyel_admin_promo_notice_dismissed2', 1 );
221
222 wp_safe_redirect(
223 remove_query_arg( [ 'easyel_promo_notice_dismiss', '_wpnonce' ] )
224 );
225 exit;
226 }
227
228 public function init() {
229 // Safety checks
230
231 add_filter( 'body_class', [ $this, "easy_add_extra_body_class" ] );
232 add_action( 'easy_header', [ $this, 'easyel_before_content_container_hfe'], 20 );
233 add_action( 'easy_footer', [ $this, 'easyel_after_content_container_hfe' ], 5 );
234
235 add_action( 'admin_notices', [ $this, 'easyelements_admin_notice_missing_elementor' ] );
236 }
237
238 public function easyel_plugin_loaded () {
239
240 \Easyel\EasyElements\Utils\Enqueue::get_instance();
241 \Easyel\EasyElements\Utils\QueryHelper::get_instance();
242
243 if( is_admin() ) {
244 \Easyel\EasyElements\Admin\Admin_Settings::get_instance();
245 }
246
247 if ( did_action( 'elementor/loaded' ) ) {
248 \Easyel\EasyElements\Template_Library\Easyel_Templates_Library::get_instance();
249 \Easyel\EasyElements\Starter_Template\Easyel_Starter_Template::get_instance();
250 \Easyel\EasyElements\Header_Footer_Builder\Classes\Easy_Header_Footer_Elementor::get_instance();
251 }
252
253 \Easyel\EasyElements\Theme_Builder\Easyel_Theme_Builder_CPT::get_instance();
254
255 \Easyel\EasyElements\Theme_Builder\Easyel_Theme_Builder_Front::get_instance();
256
257 \Easyel\EasyElements\PostType\OffcanvasPostType::get_instance();
258 \Easyel\EasyElements\CustomCode\Easyel_Custom_Code::get_instance();
259 \Easyel\EasyElements\Popup_Builder\Easyel_Popup_Builder::get_instance();
260 \Easyel\EasyElements\Extensions\ExtensionHook\ExtensionModule::get_instance();
261 \Easyel\EasyElements\Extensions\CustomCss\EasyelCustomCss::get_instance()->init();
262 \Easyel\EasyElements\Extensions\Duplicator\EasyelDuplicator::get_instance();
263 \Easyel\EasyElements\Extensions\SettingExport\EasyelExport::get_instance();
264 \Easyel\EasyElements\Extensions\LiveCopy\CopyPaste::get_instance();
265 \Easyel\EasyElements\Extensions\VisibilityControl\VisibilityModule::get_instance();
266 \Easyel\EasyElements\Extensions\Jarallax\JaralaxControl::get_instance()->init();
267 \Easyel\EasyElements\Extensions\Jarallax\GlobalJarallax::get_instance();
268 \Easyel\EasyElements\Extensions\ProgressBar\ReadingProgressBar::get_instance();
269
270
271 if ( ! class_exists( '\Appsero\Client' ) ) {
272 return;
273 }
274
275 \Easyel\EasyElements\Tracking\Appsero_Tracker::instance();
276 }
277
278 public function easyelements_admin_notice_missing_elementor() {
279
280 $elementor = 'elementor/elementor.php';
281
282 if ( current_user_can( 'activate_plugins' ) && isset( $_GET['activate'], $_GET['_wpnonce'] ) ) {
283
284 $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';
285
286 if ( wp_verify_nonce( $nonce, 'activate-plugin_' . $elementor ) ) {
287 unset( $_GET['activate'] );
288 }
289 }
290
291 if ( ! current_user_can( 'install_plugins' ) ) {
292 return;
293 }
294
295 $elementor = 'elementor/elementor.php';
296 $elementor_path = WP_PLUGIN_DIR . '/' . $elementor;
297
298 $is_installed = file_exists( $elementor_path );
299 $is_active = function_exists( 'is_plugin_active' ) && is_plugin_active( $elementor );
300
301 if ( $is_active ) {
302 return;
303 }
304
305 if ( $is_installed ) {
306 $action_url = wp_nonce_url(
307 self_admin_url( 'plugins.php?action=activate&plugin=' . $elementor ),
308 'activate-plugin_' . $elementor
309 );
310
311 $button_label = esc_html__( 'Activate Elementor', 'easy-elements' );
312 $notice_text = esc_html__( 'Easy Elements is not working because the Elementor plugin is inactive.', 'easy-elements' );
313
314 } else {
315 $action_url = wp_nonce_url(
316 self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ),
317 'install-plugin_elementor'
318 );
319
320 $button_label = esc_html__( 'Install Elementor', 'easy-elements' );
321 $notice_text = esc_html__( 'Easy Elements requires the Elementor plugin to be installed.', 'easy-elements' );
322 }
323
324 $message = '<p>' . $notice_text . '</p>';
325 $message .= '<p><a href="' . esc_url( $action_url ) . '" class="button-primary">' . $button_label . '</a></p>';
326
327 printf(
328 '<div class="notice notice-error is-dismissible">%s</div>',
329 wp_kses_post( $message )
330 );
331 }
332
333 // Container Full site
334 public function easyel_before_content_container_hfe() {
335 if ( is_admin() ) return;
336 if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
337 return;
338 }
339 echo '<div class="easyel-content-container">';
340 }
341
342 /**
343 * Close container before HFE Footer
344 */
345 function easyel_after_content_container_hfe() {
346 if ( is_admin() ) return;
347 if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
348 return;
349 }
350 echo '</div>';
351 }
352
353 public function easy_add_extra_body_class( $classes ) {
354 if ( is_plugin_active( 'easy-elements/easy-elements.php' ) ) {
355 $classes[] = 'eel-easy-elements';
356 }
357
358 return $classes;
359 }
360
361 public function add_elementor_categories( $elements_manager ) {
362
363 $new_categories = [
364 'easyelements_category' => [
365 'title' => __( 'Easy Elements', 'easy-elements' ),
366 'icon' => 'fa fa-plug',
367 ],
368 'easyelements_post_category' => [
369 'title' => __( 'Easy Post Type Elements', 'easy-elements' ),
370 'icon' => 'fa fa-file-alt',
371 ],
372 'easyelements_header_footer_category' => [
373 'title' => __( 'Easy Header Footer Elements', 'easy-elements' ),
374 'icon' => 'fa fa-header',
375 ],
376 'easyelements_category_form' => [
377 'title' => __( 'Easy Elements Form', 'easy-elements' ),
378 'icon' => 'fa fa-plug',
379 ],
380 'easyelements_category_pro' => [
381 'title' => __( 'Easy Elements Pro', 'easy-elements' ),
382 'icon' => 'fa fa-plug',
383 ],
384 ];
385
386 $existing = $elements_manager->get_categories();
387 $final_list = [];
388
389 foreach ( $existing as $key => $cat ) {
390 $final_list[ $key ] = $cat;
391
392 if ( $key === 'layout' ) {
393 foreach ( $new_categories as $new_key => $new_cat ) {
394 $final_list[ $new_key ] = $new_cat;
395 }
396 }
397 }
398
399 $apply_categories = function( $cats ) {
400 $this->categories = $cats;
401 };
402
403 $apply_categories->call( $elements_manager, $final_list );
404 }
405
406 public function init_widgets() {
407 $widgets_manager = \Elementor\Plugin::instance()->widgets_manager;
408
409 $widgets = [
410 'site_logo' => [
411 'class' => '\Easyel\EasyElements\Widgets\Easyel_Site_Logo_Widget',
412 'file' => EASYELEMENTS_DIR_PATH . '/widgets/site-logo/site-logo.php',
413 'tab' => 'widget'
414 ],
415 'heading' => [
416 'class' => '\Easyel\EasyElements\Widgets\Easyel_Heading_Widget',
417 'file' => EASYELEMENTS_DIR_PATH . '/widgets/heading/heading.php',
418 'tab' => 'widget'
419 ],
420 'clients_logo' => [
421 'class' => '\Easyel\EasyElements\Widgets\Easyel_Clients_Logo__Widget',
422 'file' => EASYELEMENTS_DIR_PATH . '/widgets/clients-logo-grid/logo.php',
423 'tab' => 'widget'
424 ],
425 'icon_box' => [
426 'class' => '\Easyel\EasyElements\Widgets\Easyel_Icon_Box__Widget',
427 'file' => EASYELEMENTS_DIR_PATH . '/widgets/icon-box/icon.php',
428 'tab' => 'widget'
429 ],
430 'simple_tab' => [
431 'class' => '\Easyel\EasyElements\Widgets\Easyel_Tab_Widget',
432 'file' => EASYELEMENTS_DIR_PATH . '/widgets/tab/tab.php',
433 'tab' => 'widget'
434 ],
435 'testimonials' => [
436 'class' => '\Easyel\EasyElements\Widgets\Easyel_Testimonials__Widget',
437 'file' => EASYELEMENTS_DIR_PATH . '/widgets/testimonials-grid/testimonials.php',
438 'tab' => 'widget'
439 ],
440 'team_grid' => [
441 'class' => '\Easyel\EasyElements\Widgets\Easyel_Team_Grid__Widget',
442 'file' => EASYELEMENTS_DIR_PATH . '/widgets/team-grid/team-grid.php',
443 'tab' => 'widget'
444 ],
445 'search' => [
446 'class' => '\Easyel\EasyElements\Widgets\Easyel_Search_Widget',
447 'file' => EASYELEMENTS_DIR_PATH . '/widgets/search/search.php',
448 'tab' => 'widget'
449 ],
450 'contact_box' => [
451 'class' => '\Easyel\EasyElements\Widgets\Easyel_Contact_Box__Widget',
452 'file' => EASYELEMENTS_DIR_PATH . '/widgets/contact-box/contact.php',
453 'tab' => 'widget'
454 ],
455 'faq' => [
456 'class' => '\Easyel\EasyElements\Widgets\Easyel_FAQ_Accordion_Widget',
457 'file' => EASYELEMENTS_DIR_PATH . '/widgets/faq/faq.php',
458 'tab' => 'widget'
459 ],
460 'blog_grid' => [
461 'class' => '\Easyel\EasyElements\Widgets\Easyel_Blog_Grid__Widget',
462 'file' => EASYELEMENTS_DIR_PATH . '/widgets/blog-grid/blog-grid.php',
463 'tab' => 'widget'
464 ],
465 'video' => [
466 'class' => '\Easyel\EasyElements\Widgets\Easyel_Video_Popup_Widget',
467 'file' => EASYELEMENTS_DIR_PATH . '/widgets/video/video.php',
468 'tab' => 'widget'
469 ],
470 'pricing_table' => [
471 'class' => '\Easyel\EasyElements\Widgets\Easyel_Pricing_Table_Widget',
472 'file' => EASYELEMENTS_DIR_PATH . '/widgets/pricing-table/pricing.php',
473 'tab' => 'widget'
474 ],
475 'service_list' => [
476 'class' => '\Easyel\EasyElements\Widgets\Easyel_Service_List_Widget',
477 'file' => EASYELEMENTS_DIR_PATH . '/widgets/service-list/service-list.php',
478 'tab' => 'widget'
479 ],
480 'navigation_menu' => [
481 'class' => '\Easyel\EasyElements\Widgets\Easyel_Navigation_Menu_Widget',
482 'file' => EASYELEMENTS_DIR_PATH . '/widgets/navigation-menu/navigation-menu.php',
483 'tab' => 'widget'
484 ],
485 'page_title' => [
486 'class' => '\Easyel\EasyElements\Widgets\Easyel_Page_Title_Widget',
487 'file' => EASYELEMENTS_DIR_PATH . '/widgets/page-title/page-title.php',
488 'tab' => 'widget'
489 ],
490 'button' => [
491 'class' => '\Easyel\EasyElements\Widgets\Easyel_Button_Widget',
492 'file' => EASYELEMENTS_DIR_PATH . '/widgets/button/button.php',
493 'tab' => 'widget'
494 ],
495 'process_grid' => [
496 'class' => '\Easyel\EasyElements\Widgets\Easyel_Process_Grid_Widget',
497 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-grid/process-grid.php',
498 'tab' => 'widget'
499 ],
500 'process_list' => [
501 'class' => '\Easyel\EasyElements\Widgets\Easyel_Process_lists_Widget',
502 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-list/process-list.php',
503 'tab' => 'widget'
504 ],
505 'social_share' => [
506 'class' => '\Easyel\EasyElements\Widgets\Easyel_Social_Share_Widget',
507 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-share/social-share.php',
508 'tab' => 'widget'
509 ],
510 'social_icon' => [
511 'class' => '\Easyel\EasyElements\Widgets\Easyel_Social_Icon_Widget',
512 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-icon/social.php',
513 'tab' => 'widget'
514 ],
515 'breadcrumb' => [
516 'class' => '\Easyel\EasyElements\Widgets\Easyel_Breadcrumb_Widget',
517 'file' => EASYELEMENTS_DIR_PATH . '/widgets/breadcrumb/breadcrumb.php',
518 'tab' => 'widget'
519 ],
520 'domain_search' => [
521 'class' => '\Easyel\EasyElements\Widgets\Easyel_Domain_Search_Widget',
522 'file' => EASYELEMENTS_DIR_PATH . '/widgets/domain-search/domain-search.php',
523 'tab' => 'widget'
524 ],
525 'image_comparison' => [
526 'class' => '\Easyel\EasyElements\Widgets\Easyel_Before_After_Widget',
527 'file' => EASYELEMENTS_DIR_PATH . '/widgets/image-comparison/img-before-after.php',
528 'tab' => 'widget'
529 ],
530 'easy_offcanvas' => [
531 'class' => '\Easyel\EasyElements\Widgets\Easyel_Offcanvas_Widget',
532 'file' => EASYELEMENTS_DIR_PATH . '/widgets/offcanvas/offcanvas.php',
533 'tab' => 'widget'
534 ],
535 'easy_table' => [
536 'class' => '\Easyel\EasyElements\Widgets\Easyel_Table_Elementor_Widget',
537 'file' => EASYELEMENTS_DIR_PATH . '/widgets/table/table-normal.php',
538 'tab' => 'widget'
539 ],
540 'easy_scroll_to_top' => [
541 'class' => '\Easyel\EasyElements\Widgets\Easyel_Scroll_To_Top_Widget',
542 'file' => EASYELEMENTS_DIR_PATH . '/widgets/scroll-to-top/scroll.php',
543 'tab' => 'widget'
544 ],
545 'easy_cf7' => [
546 'class' => '\Easyel\EasyElements\Widgets\easyel__CF7_Widget',
547 'file' => EASYELEMENTS_DIR_PATH . '/widgets/cf7/contact-cf7.php',
548 'tab' => 'widget'
549 ],
550 'easy_gallery' => [
551 'class' => '\Easyel\EasyElements\Widgets\Easyel__Gallery_Widget',
552 'file' => EASYELEMENTS_DIR_PATH . '/widgets/gallery/gallery.php',
553 'tab' => 'widget'
554 ],
555 'easy_progress' => [
556 'class' => '\Easyel\EasyElements\Widgets\Easyel_Progress_Widget',
557 'file' => EASYELEMENTS_DIR_PATH . '/widgets/progress/progress.php',
558 'tab' => 'widget'
559 ],
560 'counter' => [
561 'class' => '\Easyel\EasyElements\Widgets\Easyel_Counter_Widget',
562 'file' => EASYELEMENTS_DIR_PATH . '/widgets/counter/counter.php',
563 'tab' => 'widget'
564 ],
565 'countdown' => [
566 'class' => '\Easyel\EasyElements\Widgets\Easyel_Count_Down_Widget',
567 'file' => EASYELEMENTS_DIR_PATH . '/widgets/countdown/countdown.php',
568 'tab' => 'widget'
569 ],
570 'excerpt' => [
571 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Excerpt_Widget',
572 'file' => EASYELEMENTS_DIR_PATH . '/widgets/excerpt/excerpt.php',
573 'tab' => 'widget'
574 ],
575 'post_title' => [
576 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Title_Widget',
577 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-title/post-title.php',
578 'tab' => 'widget'
579 ],
580 'post_content' => [
581 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_content_Widget',
582 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-content/post-content.php',
583 'tab' => 'widget'
584 ],
585 'featured_image' => [
586 'class' => '\Easyel\EasyElements\Widgets\Easyel_free_Featured_Image_Widget',
587 'file' => EASYELEMENTS_DIR_PATH . '/widgets/featured-image/featured-image.php',
588 'tab' => 'widget'
589 ],
590 'post_meta' => [
591 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Meta_Widget',
592 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-meta/post-meta.php',
593 'tab' => 'widget'
594 ],
595 'post_pagination' => [
596 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Pagination_Widget',
597 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-pagination/post-pagination.php',
598 'tab' => 'widget'
599 ],
600 'post_comments' => [
601 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Comments_Widget',
602 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-comments/post-comments.php',
603 'tab' => 'widget'
604 ],
605 'post_tags' => [
606 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Tags_Widget',
607 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-tag/post-tag.php',
608 'tab' => 'widget'
609 ],
610 'post_author' => [
611 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Author_Info_Widget',
612 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-author/post-author.php',
613 'tab' => 'widget'
614 ],
615 'archive_post' => [
616 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Archive_Post__Widget',
617 'file' => EASYELEMENTS_DIR_PATH . '/widgets/archive-post/archive-post.php',
618 'tab' => 'widget',
619 ],
620 'login_register' => [
621 'class' => '\Easyel\EasyElements\Widgets\Easyel_Login_Register_Widget',
622 'file' => EASYELEMENTS_DIR_PATH . '/widgets/login-register/login-register.php',
623 'tab' => 'widget',
624 ],
625 'feature_list' => [
626 'class' => '\Easyel\EasyElements\Widgets\Easyel_Feature_List__Widget',
627 'file' => EASYELEMENTS_DIR_PATH . '/widgets/feature-list/feature-list.php',
628 'tab' => 'widget',
629 ],
630 'single_navigation_menu' => [
631 'class' => '\Easyel\EasyElements\Widgets\Easyel_Single_Nav_Widget',
632 'file' => EASYELEMENTS_DIR_PATH . '/widgets/single-nav/single-nav.php',
633 'tab' => 'widget',
634 ],
635 'vertical_navigation_menu' => [
636 'class' => '\Easyel\EasyElements\Widgets\Easyel_vertical_Menu_Widget',
637 'file' => EASYELEMENTS_DIR_PATH . '/widgets/vertical-menu/vertical-menu-widget.php',
638 'tab' => 'widget',
639 ]
640 ];
641
642 foreach ( $widgets as $key => $data ) {
643 $option_name = 'easy_element_' . $data['tab'] . '_' . $key;
644 $enabled = get_option( $option_name, '1' );
645
646 if ( 1 !== ( int ) $enabled ) {
647 continue; // Skip disabled widgets
648 }
649
650 if ( file_exists( $data['file'] ) ) {
651 require_once $data['file'];
652
653 if ( class_exists( $data['class'] ) ) {
654 $widgets_manager->register( new $data['class']() );
655 }
656 }
657 }
658 }
659
660 public function easyel_setting_page_link( $links ) {
661 $action_link = sprintf("<a href='%s'>%s</a>",admin_url('admin.php?page=easy-elements-dashboard'),__('Settings','easy-elements'));
662 array_push( $links,$action_link );
663 return $links;
664 }
665
666 }
667
668 Easyel_Elements_Elementor_Extension::instance();