PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.3.9
Easy Elements for Elementor – Addons & Website Templates v1.3.9
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.3.9, at base.php

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