PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.0.7
Easy Elements for Elementor – Addons & Website Templates v1.0.7
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 / admin / settings.php

settings.php in Easy Elements for Elementor – Addons & Website Templates 1.0.7, at admin/settings.php

1,086 lines 49.9 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 class Easyel_Elements {
7
8 // Singleton instance
9 private static $instance = null;
10
11 private function __construct() {
12 // Hooks
13
14 // Custom Font Load Free
15
16 add_action( 'admin_menu', array( $this, 'easyel_elements_settings_menu' ) );
17 add_action( 'admin_init', array( $this, 'easyel_elements_register_settings' ) );
18
19 $this->easyel_settings_ajax();
20
21 }
22
23 public function easyel_settings_ajax( ) {
24
25 // AJAX handler for saving minify js option
26
27 add_action('wp_ajax_easy_elements_save_widget_setting', array( $this, "easy_elements_save_widget_setting" ) );
28 add_action('wp_ajax_easy_elements_bulk_action', array( $this, 'easy_elements_bulk_action') );
29 add_action('wp_ajax_easy_elements_toggle_widget', array( $this, 'easyel_elements_toggle_widget_callback') ) ;
30 add_action('wp_ajax_easy_elements_save_global_extensions', array( $this, 'easy_elements_save_global_extensions') ) ;
31 add_action('wp_ajax_easy_elements_save_global_extensions_bulk', array( $this, 'easy_elements_save_global_extensions_bulk') ) ;
32
33 add_action('admin_enqueue_scripts', array( $this, 'easyel_elements_enqueue_admin_assets') );
34 add_action( 'admin_head', array( $this, 'easyel_hide_admin_notices' ) );
35 }
36
37 // Singleton get_instance
38 public static function get_instance() {
39 if (self::$instance === null) {
40 self::$instance = new self();
41 }
42 return self::$instance;
43 }
44
45 public function easyel_elements_settings_menu() {
46
47 // Main Menu
48 add_menu_page(
49 __('Easy Elements', 'easy-elements'),
50 __('Easy Elements', 'easy-elements'),
51 'manage_options',
52 'easy-elements-dashboard',
53 array( $this, 'easyel_elements_settings_callback' ),
54 'dashicons-admin-generic',
55 59
56 );
57
58 global $submenu;
59
60 // Main slug
61 $slug = 'easy-elements-dashboard';
62
63 $submenu[$slug][] = [ __('Overview', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#overview' ];
64 $submenu[$slug][] = [ __('Widgets', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#widget' ];
65 $submenu[$slug][] = [ __('All Extensions', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#extensions' ];
66
67 // Header & Footer Submenu
68 add_submenu_page(
69 'easy-elements-dashboard',
70 __('Header & Footer', 'easy-elements'),
71 __('Header & Footer', 'easy-elements'),
72 'manage_options',
73 'edit.php?post_type=ee-elementor-hf'
74 );
75
76 // Upload Custom Fonts Submenu
77 add_submenu_page(
78 'easy-elements-dashboard',
79 __('Upload Custom Fonts', 'easy-elements'),
80 __('Upload Custom Fonts', 'easy-elements'),
81 'manage_options',
82 'easyel-custom-fonts',
83 array( $this, 'easyel_custom_fonts_page_html' )
84 );
85
86 // Off Canvas Submenu
87 add_submenu_page(
88 'easy-elements-dashboard',
89 __('Off Canvas', 'easy-elements'),
90 __('Off Canvas', 'easy-elements'),
91 'manage_options',
92 'edit.php?post_type=easy-offcanvas'
93 );
94 }
95
96 public function easyel_elements_register_settings() {
97 register_setting( 'easyel_elements_extensions_group', 'easyel_enable_js_animation', [
98 'sanitize_callback' => 'absint',
99 'default' => 0,
100 ] );
101
102 // Cursor setting register
103 register_setting( 'easyel_elements_extensions_group', 'easyel_enable_cursor', [
104 'sanitize_callback' => 'absint',
105 'default' => 0,
106 ] );
107 }
108
109 public function easy_elements_save_global_extensions_bulk() {
110 if ( ! current_user_can( 'manage_options' ) ) {
111 wp_send_json_error( __( 'Unauthorized', 'easy-elements' ) );
112 }
113
114 check_ajax_referer( 'easy_elements_widget_settings_nonce', 'nonce' );
115
116 $tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
117 $keys = isset( $_POST['keys'] ) ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['keys'] ) ) : [];
118 $status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
119 $group_slug = isset( $_POST['group'] ) ? sanitize_text_field( wp_unslash( $_POST['group'] ) ) : '';
120
121 if ( empty( $keys ) ) {
122 wp_send_json_error( [ 'message' => __( 'No keys provided', 'easy-elements' ) ] );
123 }
124
125 $settings = get_option( 'easy_element_' . $tab, [] );
126 foreach ( $keys as $key ) {
127 $key = sanitize_text_field( $key );
128 $settings[ $key ] = $status;
129 }
130 update_option( 'easy_element_' . $tab, $settings );
131
132 if ( $group_slug ) {
133 update_option( 'easy_element_group_' . $group_slug, $status );
134 }
135
136 wp_send_json_success( [ 'message' => __( 'Bulk settings updated', 'easy-elements' ) ] );
137 }
138
139 public function easy_elements_save_global_extensions() {
140 if (!current_user_can('manage_options')) {
141 wp_send_json_error(__('Unauthorized', 'easy-elements'));
142 }
143
144 check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
145
146 $tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
147 $key = isset($_POST['key']) ? sanitize_text_field( wp_unslash( $_POST['key'] )) : '';
148 $status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
149
150 if (!$key) {
151 wp_send_json_error(['message' => __('Invalid key', 'easy-elements')]);
152 }
153
154 $settings = get_option('easy_element_' . $tab, []);
155 $settings[$key] = $status;
156
157 update_option('easy_element_' . $tab, $settings);
158
159 wp_send_json_success(['message' => __('Settings updated', 'easy-elements')]);
160 }
161
162
163 // AJAX handler for saving individual widget settings
164
165 public function easy_elements_save_widget_setting() {
166 if (!current_user_can('manage_options')) {
167 wp_send_json_error(__('Unauthorized', 'easy-elements'));
168 }
169 check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
170
171 $widget_key = isset($_POST['widget_key']) ? sanitize_text_field( wp_unslash($_POST['widget_key'] ) ) : '';
172 $status = isset($_POST['status']) && $_POST['status'] === '1' ? '1' : '0';
173 $tab_slug = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
174
175 if (!empty( $widget_key ) ) {
176 $option_name = 'easy_element_' . $tab_slug . '_' . $widget_key;
177
178 update_option($option_name, $status);
179
180 wp_send_json_success([
181 'message' => __('Widget setting updated successfully', 'easy-elements'),
182 'status' => $status,
183 ]);
184 } else {
185 wp_send_json_error(['message' => __('Invalid widget key', 'easy-elements')]);
186 }
187 }
188
189 // AJAX handler for bulk actions
190 public function easy_elements_bulk_action() {
191 if (!current_user_can('manage_options')) {
192 wp_send_json_error(__('Unauthorized', 'easy-elements'));
193 }
194 check_ajax_referer('easy_elements_bulk_action_nonce', 'nonce');
195
196 $bulk_action = isset($_POST['bulk_action']) ? sanitize_text_field(wp_unslash($_POST['bulk_action'])) : '';
197 $tab = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
198 $status = $bulk_action === 'activate_all' ? '1' : '0';
199
200 $available_elements = $this->easyel_elements_get_available_widgets();
201 $updated_count = 0;
202
203 $is_pro_active = class_exists('Easy_Elements_Pro');
204
205 foreach ($available_elements as $key => $widget) {
206 if (isset($widget['tab']) && $widget['tab'] === $tab) {
207 $option_name = 'easy_element_' . $tab . '_' . $key;
208
209 if (!$is_pro_active && isset($widget['is_pro']) && $widget['is_pro']) {
210 update_option($option_name, '0');
211 } else {
212 $status = $bulk_action === 'activate_all' ? '1' : '0';
213 update_option($option_name, $status);
214 }
215 }
216 }
217
218 wp_send_json_success([
219 'message' => sprintf('%d widgets %s successfully', $updated_count, $status ? 'activated' : 'deactivated'),
220 'count' => $updated_count,
221 'is_pro_active' => $is_pro_active
222 ]);
223 }
224
225
226 function easyel_elements_settings_callback() {
227 $available_elements = $this->easyel_elements_get_available_widgets();
228
229 $easyel_tabs = [
230 'overview' => __('Overview', 'easy-elements'),
231 'widget' => __('All Widgets', 'easy-elements'),
232 'extensions' => __('All Extensions', 'easy-elements'),
233 'advsettings' => __('Advanced Settings', 'easy-elements'),
234 ];
235
236 $easyel_tab_list = apply_filters("easyel_all_tab_list", $easyel_tabs );
237
238 ?>
239 <div class="easyel-overview-header">
240 <img src="<?php echo esc_url( EASYELEMENTS_DIR_URL . 'admin/img/easy-logo.png' ); ?>" alt="<?php echo esc_attr( 'logo' ); ?>">
241
242 </div>
243 <div class=" easyel-plugin-settings-wrapper">
244 <div class="easyel-nav-tab-item">
245 <div class="easyel-nav-tab-wrapper easyel-border-radius-20">
246 <a href="#overview" class="easyel-nav-tab easyel-nav-tab-active" data-tab="overview"><i class="easyelIcon-home"></i> <?php esc_html_e ('Overview','easy-elements'); ?></a>
247 <a href="#widget" class="easyel-nav-tab" data-tab="widget"><i class="easyelIcon-widgets"></i><?php esc_html_e('All Widgets','easy-elements'); ?></a>
248 <a href="#extensions" class="easyel-nav-tab" data-tab="extensions"><i class="easyelIcon-extension"></i><?php esc_html_e('All Extensions','easy-elements'); ?></a>
249
250 <a href="<?php echo esc_url( admin_url( 'admin.php?page=easy-elements-license' ) ); ?>"
251 class="easyel-nav-tab"
252 data-tab="activate_license">
253 <i class="easyelIcon-extension"></i>
254 <?php esc_html_e('Activate License','easy-elements'); ?>
255 </a>
256 <div class="easyel-tab-pro-link">
257 <a href="https://wpeasyelements.com/pricing/" class="easyel-nav-tab-pro" target="_blank">
258 <i class="easyelIcon-crown"></i>
259 <?php esc_html_e('Go Premium','easy-elements'); ?>
260 </a>
261 </div>
262 </div>
263 </div>
264 <!-- Status Messages -->
265 <div id="bulk-action-message" class="notice" style="display: none;"></div>
266
267 <!-- Tab Content -->
268 <div id="easyel-tab-content">
269 <?php foreach ( $easyel_tabs as $tab_slug => $tab_label ) : ?>
270 <div id="tab-<?php echo esc_attr($tab_slug); ?>"
271 class="easyel-tab-panel easyel-border-radius-20 <?php echo esc_attr($tab_slug); ?>"
272 style="<?php echo $tab_slug === 'overview' ? '' : 'display:none;'; ?>">
273
274 <?php
275 if ( $tab_slug === 'widget' ) : ?>
276 <div class="easyel-addon-search easyel-dflex easyel-justify-between">
277 <div class="easyel-widget-filter">
278 <h1 class="easyel-dashboard-heading"><?php esc_html_e('Widgets','easy-elements');?></h1>
279 <div class="easyel-widget-filter-button">
280 <button type="button" id="easyel_all" class="easyel-action-btn active" data-filter="easyel_all"><?php esc_html_e('All', 'easy-elements'); ?></button>
281 <button type="button" id="easyel_free" class="easyel-action-btn" data-filter="easyel_free"><?php esc_html_e('Free', 'easy-elements'); ?></button>
282 <button type="button" id="easyel_pro" class="easyel-action-btn" data-filter="easyel_pro"><?php esc_html_e('Pro', 'easy-elements'); ?></button>
283 </div>
284 </div>
285 <div class="easyel-widget-search-enable">
286 <div class="easyel-widget-activeDeactivate-button">
287 <button type="button" id="activate-all-btn"><?php esc_html_e('Activate All', 'easy-elements'); ?></button>
288 <button type="button" id="deactivate-all-btn"><?php esc_html_e('Deactivate All', 'easy-elements'); ?></button>
289 </div>
290 <?php if ( $tab_slug === 'widget' ) { ?>
291 <input type="text" id="element-search" placeholder="<?php esc_attr_e('Search widgets...', 'easy-elements'); ?>">
292 <?php } ?>
293 </div>
294 </div>
295 <?php endif; ?>
296 <?php
297 $tab_file = EASYELEMENTS_DIR_PATH . '/admin/settingstab/tab-' . $tab_slug . '.php';
298
299 if ( file_exists( $tab_file ) ) {
300 include $tab_file;
301 }
302 ?>
303 </div>
304 <?php endforeach; ?>
305 </div>
306
307 </div>
308
309 <!-- JavaScript functionality is handled by admin.js -->
310 <?php
311 }
312
313 ////////****************** AJAX Toggle ********************************
314
315 public function easyel_elements_toggle_widget_callback() {
316 if (!current_user_can('manage_options') || !check_ajax_referer('easy_elements_nonce', 'nonce', false)) {
317 wp_send_json_error('Unauthorized');
318 }
319 $key = isset($_POST['key']) ? sanitize_text_field(wp_unslash($_POST['key'])) : '';
320 $status = (isset($_POST['status']) && $_POST['status'] === '1') ? '1' : '0';
321 update_option('easy_element_' . $key, $status);
322 wp_send_json_success('Updated');
323 }
324
325 public function Easyel_Elements_enqueue_admin_assets($hook) {
326 if (strpos($hook, 'easy-elements') === false) {
327 return;
328 }
329
330 // Enqueue admin JavaScript
331 wp_enqueue_script(
332 'easy-elements-admin',
333 plugin_dir_url(__DIR__) . 'assets/js/admin.js',
334 ['jquery'],
335 '1.0.0',
336 true
337 );
338
339 // Localize script with all necessary data
340 wp_localize_script('easy-elements-admin', 'easyElementsData', [
341 'ajaxurl' => admin_url('admin-ajax.php'),
342 'nonce' => wp_create_nonce('easy_elements_nonce'),
343 'widget_settings_nonce' => wp_create_nonce('easy_elements_widget_settings_nonce'),
344 'bulk_action_nonce' => wp_create_nonce('easy_elements_bulk_action_nonce'),
345 'advance_settings_nonce' => wp_create_nonce('easy_elements_save_advance_settings_nonce'),
346 'js_animation_nonce' => wp_create_nonce('easyel_js_animation_nonce'),
347 'strings' => [
348 'confirm_activate_all' => __('Are you sure you want to activate all widgets?', 'easy-elements'),
349 'confirm_deactivate_all' => __('Are you sure you want to deactivate all widgets?', 'easy-elements'),
350 'processing' => __('Processing...', 'easy-elements'),
351 'saving' => __('Saving...', 'easy-elements'),
352 'saved' => __('Saved!', 'easy-elements'),
353 'error' => __('Error!', 'easy-elements'),
354 'updated' => __('Updated!', 'easy-elements'),
355 ]
356 ]);
357 }
358
359 function easyel_elements_get_available_widgets() {
360 $widgets = [
361 'heading' => [
362 'icon' => 'easyelIcon-heading',
363 'title' => 'Heading',
364 'description' => 'Add customizable headings with style options.',
365 'demo_url' => 'https://wpeasyelements.com/heading/',
366 'docx_url' => 'https://wpeasyelements.com/docs/heading/',
367 'is_pro' => false,
368 'tab' => 'widget',
369 ],
370 'clients_logo' => [
371 'icon' => 'easyelIcon-clients-logo-grid',
372 'title' => 'Clients Logo Grid',
373 'description' => 'Showcase client logos in a neat grid layout.',
374 'demo_url' => 'https://wpeasyelements.com/clients-logo-grid/',
375 'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-grid',
376 'is_pro' => false,
377 'tab' => 'widget',
378 ],
379 'clients_logo_slider' => [
380 'icon' => 'easyelIcon-clients-logo-slider',
381 'title' => 'Clients Logo Slider',
382 'description' => 'Display client logos in a slider format.',
383 'demo_url' => 'https://wpeasyelements.com/clients-logo-slider/',
384 'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-slider/',
385 'is_pro' => true,
386 'tab' => 'widget',
387 ],
388 'tab' => [
389 'icon' => 'easyelIcon-tab',
390 'title' => 'Tab',
391 'description' => 'Add simple tab content.',
392 'demo_url' => 'https://wpeasyelements.com/tab',
393 'docx_url' => 'https://wpeasyelements.com/docs/tab',
394 'is_pro' => false,
395 'tab' => 'widget',
396 ],
397 'tab_advance' => [
398 'icon' => 'easyelIcon-tab',
399 'title' => 'Advanced Tab',
400 'description' => 'Create advanced tab content.',
401 'demo_url' => 'https://wpeasyelements.com/advanced-tab/',
402 'docx_url' => 'https://wpeasyelements.com/docs/advanced-tab/',
403 'is_pro' => true,
404 'tab' => 'widget',
405 ],
406 'testimonials' => [
407 'icon' => 'easyelIcon-testimonials-grid',
408 'title' => 'Testimonials Grid',
409 'description' => 'Show testimonials in a grid format.',
410 'demo_url' => 'https://wpeasyelements.com/testimonials-grid',
411 'docx_url' => 'https://wpeasyelements.com/docs/testimonials-grid',
412 'is_pro' => false,
413 'tab' => 'widget',
414 ],
415 'testimonials_slider' => [
416 'icon' => 'easyelIcon-testimonials-slider',
417 'title' => 'Testimonials Slider',
418 'description' => 'Display testimonials in a slider format.',
419 'demo_url' => 'https://wpeasyelements.com/testimonials-slider/',
420 'docx_url' => 'https://wpeasyelements.com/docs/testimonials-slider/',
421 'is_pro' => true,
422 'tab' => 'widget',
423 ],
424 'image_carousel' => [
425 'icon' => 'easyelIcon-image-carousel',
426 'title' => 'Image Carousel',
427 'description' => 'Create an image slider with multiple images.',
428 'demo_url' => 'https://wpeasyelements.com/image-carousel/',
429 'docx_url' => 'https://wpeasyelements.com/docs/image-carousel',
430 'is_pro' => true,
431 'tab' => 'widget',
432 ],
433 'image_reveal' => [
434 'icon' => 'easyelIcon-marquee-logo',
435 'title' => 'Reveal Image',
436 'description' => 'reveal Image Here',
437 'demo_url' => 'https://wpeasyelements.com/reveal-image/',
438 'docx_url' => 'https://wpeasyelements.com/docs/reveal-image/',
439 'is_pro' => true,
440 'tab' => 'widget',
441 ],
442 'rotate_text' => [
443 'icon' => 'easyelIcon-heading',
444 'title' => 'Rotate Text',
445 'description' => 'rotate text here',
446 'demo_url' => 'https://wpeasyelements.com/rotate-text/',
447 'docx_url' => 'https://wpeasyelements.com/docs/rotate-text/',
448 'is_pro' => true,
449 'tab' => 'widget',
450 ],
451 'icon_box' => [
452 'icon' => 'easyelIcon-iconbox',
453 'title' => 'Info Box',
454 'description' => 'Display content with an icon.',
455 'demo_url' => 'https://wpeasyelements.com/info-box',
456 'docx_url' => 'https://wpeasyelements.com/docs/info-box',
457 'is_pro' => false,
458 'tab' => 'widget',
459 ],
460 'process_grid' => [
461 'icon' => 'easyelIcon-process-grid',
462 'title' => 'Process Grid',
463 'description' => 'Show process steps in a grid format.',
464 'demo_url' => 'https://wpeasyelements.com/process-grid',
465 'docx_url' => 'https://wpeasyelements.com/docs/process-grid',
466 'is_pro' => false,
467 'tab' => 'widget',
468 ],
469 'process_slider' => [
470 'icon' => 'easyelIcon-process-slider',
471 'title' => 'Process Slider',
472 'description' => 'Show process steps in a slider.',
473 'demo_url' => 'https://wpeasyelements.com/process-slider/',
474 'docx_url' => 'https://wpeasyelements.com/docs/process-slider/',
475 'is_pro' => true,
476 'tab' => 'widget',
477 ],
478 'team_grid' => [
479 'icon' => 'easyelIcon-team-grid',
480 'title' => 'Team Grid',
481 'description' => 'Display team members in a grid format.',
482 'demo_url' => 'https://wpeasyelements.com/team-grid',
483 'docx_url' => 'https://wpeasyelements.com/docs/team-grid',
484 'is_pro' => false,
485 'tab' => 'widget',
486 ],
487 'team_slider' => [
488 'icon' => 'easyelIcon-team-slider',
489 'title' => 'Team Slider',
490 'description' => 'Showcase team members in a slider format.',
491 'demo_url' => 'https://wpeasyelements.com/team-slider',
492 'docx_url' => 'https://wpeasyelements.com/docs/team-slider',
493 'is_pro' => true,
494 'tab' => 'widget',
495 ],
496 'contact_box' => [
497 'icon' => 'easyelIcon-contact-box',
498 'title' => 'Contact Box',
499 'description' => 'Contact Box.',
500 'demo_url' => 'https://wpeasyelements.com/contact-box',
501 'docx_url' => 'https://wpeasyelements.com/docs/contact-box',
502 'is_pro' => false,
503 'tab' => 'widget',
504 ],
505 'icon_box_slider' => [
506 'icon' => 'easyelIcon-icon-box-slider',
507 'title' => 'Info Box Slider',
508 'description' => 'Info Box Slider.',
509 'demo_url' => 'https://wpeasyelements.com/info-box-slider/',
510 'docx_url' => 'https://wpeasyelements.com/docs/info-box-slider/',
511 'is_pro' => true,
512 'tab' => 'widget',
513 ],
514 'timeline_slider' => [
515 'icon' => 'easyelIcon-timeline-slider',
516 'title' => 'Timeline Slider',
517 'description' => 'Timeline Slider.',
518 'demo_url' => 'https://wpeasyelements.com/timeline-slider/',
519 'docx_url' => 'https://wpeasyelements.com/docs/timeline-slider',
520 'is_pro' => true,
521 'tab' => 'widget',
522 ],
523 'faq' => [
524 'icon' => 'easyelIcon-faq-1',
525 'title' => 'FAQ',
526 'description' => 'FAQ.',
527 'demo_url' => 'https://wpeasyelements.com/faq',
528 'docx_url' => 'https://wpeasyelements.com/docs/faq',
529 'is_pro' => false,
530 'tab' => 'widget',
531 ],
532 'blog_grid' => [
533 'icon' => 'easyelIcon-post-grid',
534 'title' => 'Post Grid',
535 'description' => 'Post.',
536 'demo_url' => 'https://wpeasyelements.com/post-grid',
537 'docx_url' => 'https://wpeasyelements.com/docs/post-grid',
538 'is_pro' => false,
539 'tab' => 'widget',
540 ],
541 'post_slider' => [
542 'icon' => 'easyelIcon-post-slider',
543 'title' => 'Post Slider',
544 'description' => 'Post Slider.',
545 'demo_url' => 'https://wpeasyelements.com/post-slider/',
546 'docx_url' => 'https://wpeasyelements.com/docs/post-slider/',
547 'is_pro' => true,
548 'tab' => 'widget',
549 ],
550 'easy_cf7' => [
551 'icon' => 'easyelIcon-contact-form',
552 'title' => 'Contact Form 7',
553 'description' => 'Contact form 7.',
554 'demo_url' => 'https://wpeasyelements.com/contact-form-7',
555 'docx_url' => 'https://wpeasyelements.com/docs/contact-form-7',
556 'is_pro' => false,
557 'tab' => 'widget',
558 ],
559 'video' => [
560 'icon' => 'easyelIcon-video',
561 'title' => 'Video',
562 'description' => 'Video.',
563 'demo_url' => 'https://wpeasyelements.com/video',
564 'docx_url' => 'https://wpeasyelements.com/docs/video',
565 'is_pro' => false,
566 'tab' => 'widget',
567 ],
568 'pricing_table' => [
569 'icon' => 'easyelIcon-pricing-table',
570 'title' => 'Pricing Table',
571 'description' => 'Pricing Table.',
572 'demo_url' => 'https://wpeasyelements.com/pricing-table',
573 'docx_url' => 'https://wpeasyelements.com/docs/pricing-table',
574 'is_pro' => false,
575 'tab' => 'widget',
576 ],
577 'pricing_list' => [
578 'icon' => 'easyelIcon-pricing-list',
579 'title' => 'Pricing List',
580 'description' => 'Pricing List.',
581 'demo_url' => 'https://wpeasyelements.com/pricing-list/',
582 'docx_url' => 'https://wpeasyelements.com/docs/pricing-list/',
583 'is_pro' => true,
584 'tab' => 'widget',
585 ],
586 'pricing_tab' => [
587 'icon' => 'easyelIcon-pricing-table',
588 'title' => 'Pricing Tab',
589 'description' => 'Pricing Tab.',
590 'demo_url' => 'https://wpeasyelements.com/pricing-tab/',
591 'docx_url' => 'https://wpeasyelements.com/docs/pricing-tab/',
592 'is_pro' => true,
593 'tab' => 'widget',
594 ],
595 'service_list' => [
596 'icon' => 'easyelIcon-service-list',
597 'title' => 'Service List',
598 'description' => 'Service List.',
599 'demo_url' => 'https://wpeasyelements.com/service-list',
600 'docx_url' => 'https://wpeasyelements.com/docs/service-list/',
601 'is_pro' => false,
602 'tab' => 'widget',
603 ],
604 'process_list' => [
605 'icon' => 'easyelIcon-process-list',
606 'title' => 'Process List',
607 'description' => 'Process List.',
608 'demo_url' => 'https://wpeasyelements.com/process-list/',
609 'docx_url' => 'https://wpeasyelements.com/docs/process-list/',
610 'is_pro' => false,
611 'tab' => 'widget',
612 ],
613 'marquee_logo' => [
614 'icon' => 'easyelIcon-marquee-logo',
615 'title' => 'Marquee',
616 'description' => 'Marquee.',
617 'demo_url' => 'https://wpeasyelements.com/marquee/',
618 'docx_url' => 'https://wpeasyelements.com/docs/marquee/',
619 'is_pro' => true,
620 'tab' => 'widget',
621 ],
622 'button' => [
623 'icon' => 'easyelIcon-button',
624 'title' => 'Button',
625 'description' => 'Button.',
626 'demo_url' => 'https://wpeasyelements.com/button/',
627 'docx_url' => 'https://wpeasyelements.com/docs/button',
628 'is_pro' => false,
629 'tab' => 'widget',
630 ],
631 'social_share' => [
632 'icon' => 'easyelIcon-social-share',
633 'title' => 'Social Share',
634 'description' => 'Social Share.',
635 'demo_url' => 'https://wpeasyelements.com/',
636 'docx_url' => 'https://wpeasyelements.com/docs/',
637 'is_pro' => false,
638 'tab' => 'widget',
639 ],
640 'social_icon' => [
641 'icon' => 'easyelIcon-social-icons',
642 'title' => 'Social Icon',
643 'description' => 'Social Icon.',
644 'demo_url' => 'https://wpeasyelements.com/social-icon',
645 'docx_url' => 'https://wpeasyelements.com/docs/social-icon',
646 'is_pro' => false,
647 'tab' => 'widget',
648 ],
649 'breadcrumb' => [
650 'icon' => 'easyelIcon-breadcumb',
651 'title' => 'Breadcrumb',
652 'description' => 'Breadcrumb.',
653 'demo_url' => 'https://wpeasyelements.com/breadcrumb',
654 'docx_url' => 'https://wpeasyelements.com/docs/breadcrumb',
655 'is_pro' => false,
656 'tab' => 'widget',
657 ],
658 'easy_slider' => [
659 'icon' => 'easyelIcon-slider',
660 'title' => 'Slider',
661 'description' => 'Slider.',
662 'demo_url' => 'https://wpeasyelements.com/slider',
663 'docx_url' => 'https://wpeasyelements.com/docs/slider',
664 'is_pro' => true,
665 'tab' => 'widget',
666 ],
667 'image_accordion' => [
668 'icon' => 'easyelIcon-image-accordion',
669 'title' => 'Image Accordion',
670 'description' => 'Image Accordion',
671 'demo_url' => 'https://wpeasyelements.com/image-accordion/',
672 'docx_url' => 'https://wpeasyelements.com/docs/image-accordion/',
673 'is_pro' => true,
674 'tab' => 'widget',
675 ],
676 'domain_search' => [
677 'icon' => 'easyelIcon-domain-search',
678 'title' => 'Domain Search',
679 'description' => 'Domain Search.',
680 'demo_url' => 'https://wpeasyelements.com/',
681 'docx_url' => 'https://wpeasyelements.com/docs/',
682 'is_pro' => false,
683 'tab' => 'widget',
684 ],
685 'featured_project' => [
686 'icon' => 'easyelIcon-custom-projects',
687 'title' => 'Custom Projects',
688 'description' => 'Custom Projects.',
689 'demo_url' => 'https://wpeasyelements.com/',
690 'docx_url' => 'https://wpeasyelements.com/docs/',
691 'is_pro' => true,
692 'tab' => 'widget',
693 ],
694 'advance_button' => [
695 'icon' => 'easyelIcon-button',
696 'title' => 'Advance Button',
697 'description' => 'Advance Button.',
698 'demo_url' => 'https://wpeasyelements.com/advance-button/',
699 'docx_url' => 'https://wpeasyelements.com/docs/advance-button',
700 'is_pro' => true,
701 'tab' => 'widget',
702 ],
703 'hr_image_scroll' => [
704 'icon' => 'easyelIcon-image-horizontal-scroll',
705 'title' => 'Horizontal Scroll',
706 'description' => 'Horizontal Scroll.',
707 'demo_url' => 'https://wpeasyelements.com/horizontal-scroll/',
708 'docx_url' => 'https://wpeasyelements.com/docs/horizontal-scroll/',
709 'is_pro' => true,
710 'tab' => 'widget',
711 ],
712 'Flip_Box' => [
713 'icon' => 'easyelIcon-image-horizontal-scroll',
714 'title' => 'Flip Box',
715 'description' => 'Flip Box.',
716 'demo_url' => 'https://wpeasyelements.com/flip-box',
717 'docx_url' => 'https://wpeasyelements.com/docs/flip-box',
718 'is_pro' => true,
719 'tab' => 'widget',
720 ],
721 'easy_offcanvas' => [
722 'icon' => 'easyelIcon-canvas',
723 'title' => 'Offcanvas',
724 'description' => 'Offcanvas.',
725 'demo_url' => 'https://wpeasyelements.com/offcanvas',
726 'docx_url' => 'https://wpeasyelements.com/docs/offcanvas',
727 'is_pro' => false,
728 'group' => 'Header & Footer Widget',
729 'tab' => 'widget',
730 ],
731 'site_logo' => [
732 'icon' => 'easyelIcon-site-logo',
733 'title' => 'Site Logo',
734 'description' => 'Display your website logo easily with this widget.',
735 'demo_url' => 'https://wpeasyelements.com/site-logo/',
736 'docx_url' => 'https://wpeasyelements.com/docs/site-logo/',
737 'is_pro' => false,
738 'group' => 'Header & Footer Widget',
739 'tab' => 'widget',
740 ],
741 'search' => [
742 'icon' => 'easyelIcon-search',
743 'title' => 'Simple Search',
744 'description' => 'Search All Content.',
745 'demo_url' => 'https://wpeasyelements.com/search',
746 'docx_url' => 'https://wpeasyelements.com/docs/search',
747 'is_pro' => false,
748 'group' => 'Header & Footer Widget',
749 'tab' => 'widget',
750 ],
751 'navigation_menu' => [
752 'icon' => 'easyelIcon-navigation',
753 'title' => 'Navigation Menu',
754 'description' => 'Navigation Menu.',
755 'demo_url' => 'https://wpeasyelements.com/',
756 'docx_url' => 'https://wpeasyelements.com/docs/',
757 'is_pro' => false,
758 'group' => 'Header & Footer Widget',
759 'tab' => 'widget',
760 ],
761 'page_title' => [
762 'icon' => 'easyelIcon-page-title',
763 'title' => 'Page Title',
764 'description' => 'Page Title.',
765 'demo_url' => 'https://wpeasyelements.com/',
766 'docx_url' => 'https://wpeasyelements.com/docs/',
767 'is_pro' => false,
768 'group' => 'Header & Footer Widget',
769 'tab' => 'widget',
770 ],
771 'post_tags' => [
772 'icon' => 'easyelIcon-post-tag',
773 'title' => 'Current Post Tags',
774 'description' => 'Current Post Tags.',
775 'demo_url' => 'https://wpeasyelements.com/',
776 'docx_url' => 'https://wpeasyelements.com/docs/',
777 'is_pro' => false,
778 'group' => 'Theme Builder Widget',
779 'tab' => 'widget',
780 ],
781 'post_author' => [
782 'icon' => 'easyelIcon-author',
783 'title' => 'Post Author Info',
784 'description' => 'Post Author Info.',
785 'demo_url' => 'https://wpeasyelements.com/',
786 'docx_url' => 'https://wpeasyelements.com/docs/',
787 'is_pro' => false,
788 'group' => 'Theme Builder Widget',
789 'tab' => 'widget',
790 ],
791 'post_title' => [
792 'icon' => 'easyelIcon-post-title',
793 'title' => 'Post Title',
794 'description' => 'Post Title.',
795 'demo_url' => 'https://wpeasyelements.com/',
796 'docx_url' => 'https://wpeasyelements.com/docs/',
797 'is_pro' => false,
798 'group' => 'Theme Builder Widget',
799 'tab' => 'widget',
800 ],
801 'post_content' => [
802 'icon' => 'easyelIcon-post-content',
803 'title' => 'Post Content',
804 'description' => 'Post Content.',
805 'demo_url' => 'https://wpeasyelements.com/',
806 'docx_url' => 'https://wpeasyelements.com/docs/',
807 'is_pro' => false,
808 'group' => 'Theme Builder Widget',
809 'tab' => 'widget',
810 ],
811 'excerpt' => [
812 'icon' => 'easyelIcon-post-excerpt',
813 'title' => 'Post Excerpt',
814 'description' => 'Post Excerpt.',
815 'demo_url' => 'https://wpeasyelements.com/',
816 'docx_url' => 'https://wpeasyelements.com/docs/',
817 'is_pro' => false,
818 'group' => 'Theme Builder Widget',
819 'tab' => 'widget',
820 ],
821 'related_post' => [
822 'icon' => 'easyelIcon-related-post',
823 'title' => 'Related Post',
824 'description' => 'Related Post.',
825 'demo_url' => 'https://wpeasyelements.com/',
826 'docx_url' => 'https://wpeasyelements.com/docs/',
827 'is_pro' => true,
828 'group' => 'Theme Builder Widget',
829 'tab' => 'widget',
830 ],
831 'post_pagination' => [
832 'icon' => 'easyelIcon-pagination',
833 'title' => 'Post Pagination',
834 'description' => 'Post Pagination.',
835 'demo_url' => 'https://wpeasyelements.com/',
836 'docx_url' => 'https://wpeasyelements.com/docs/',
837 'is_pro' => false,
838 'group' => 'Theme Builder Widget',
839 'tab' => 'widget',
840 ],
841 'post_meta' => [
842 'icon' => 'easyelIcon-meta',
843 'title' => 'Post Meta',
844 'description' => 'Post Meta.',
845 'demo_url' => 'https://wpeasyelements.com/',
846 'docx_url' => 'https://wpeasyelements.com/docs/',
847 'is_pro' => false,
848 'group' => 'Theme Builder Widget',
849 'tab' => 'widget',
850 ],
851 'post_comments' => [
852 'icon' => 'easyelIcon-comments',
853 'title' => 'Post Comments',
854 'description' => 'Post Comments.',
855 'demo_url' => 'https://wpeasyelements.com/',
856 'docx_url' => 'https://wpeasyelements.com/docs/',
857 'is_pro' => false,
858 'group' => 'Theme Builder Widget',
859 'tab' => 'widget',
860 ],
861 'featured_image' => [
862 'icon' => 'easyelIcon-image-carousel',
863 'title' => 'Featured Image',
864 'description' => 'Featured Image.',
865 'demo_url' => 'https://wpeasyelements.com/',
866 'docx_url' => 'https://wpeasyelements.com/docs/',
867 'is_pro' => false,
868 'group' => 'Theme Builder Widget',
869 'tab' => 'widget',
870 ],
871 'easy_scroll_to_top' => [
872 'icon' => 'easyelIcon-scroll-top',
873 'title' => 'Scroll Top',
874 'description' => 'Scroll Top.',
875 'demo_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
876 'docx_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
877 'is_pro' => false,
878 'group' => 'Theme Builder Widget',
879 'tab' => 'widget',
880 ],
881 'easy_table' => [
882 'icon' => 'easyelIcon-clients-logo-grid',
883 'title' => 'Table',
884 'description' => 'Table.',
885 'demo_url' => 'https://wpeasyelements.com/table',
886 'docx_url' => 'https://wpeasyelements.com/docs/table',
887 'is_pro' => false,
888 'tab' => 'widget',
889 ],
890 'advance_image' => [
891 'icon' => 'easyelIcon-image-carousel',
892 'title' => 'Advance Image',
893 'description' => 'Advance Image Here.',
894 'demo_url' => 'https://wpeasyelements.com/advance-image/',
895 'docx_url' => 'https://wpeasyelements.com/docs/advance-image/',
896 'is_pro' => true,
897 'group' => 'Animations',
898 'tab' => 'widget',
899 ],
900 'typewriter' => [
901 'icon' => 'easyelIcon-heading',
902 'title' => 'Typewriter',
903 'description' => 'Animated typewriter text effect.',
904 'demo_url' => 'https://wpeasyelements.com/',
905 'docx_url' => 'https://wpeasyelements.com/docs/',
906 'is_pro' => true,
907 'group' => 'Animations',
908 'tab' => 'widget',
909 ],
910 'animated_title' => [
911 'icon' => 'easyelIcon-animated-title',
912 'title' => 'Animated Title',
913 'description' => 'Animated title text effect.',
914 'demo_url' => 'https://wpeasyelements.com/animated-title/',
915 'docx_url' => 'https://wpeasyelements.com/docs/',
916 'is_pro' => true,
917 'group' => 'Animations',
918 'tab' => 'widget',
919 ],
920 'easytext_animation' => [
921 'icon' => 'easyelIcon-heading',
922 'title' => 'Animated Text',
923 'description' => 'Animated text animation effect.',
924 'demo_url' => 'https://wpeasyelements.com/',
925 'docx_url' => 'https://wpeasyelements.com/docs/',
926 'is_pro' => true,
927 'group' => 'Animations',
928 'tab' => 'widget',
929 ],
930 'easy_feature' => [
931 'icon' => 'easyelIcon-marquee-logo',
932 'title' => 'Hover Image Box',
933 'description' => 'Hover image box content.',
934 'demo_url' => 'https://wpeasyelements.com/hover-image-box/',
935 'docx_url' => 'https://wpeasyelements.com/docs/hover-image-box/',
936 'is_pro' => true,
937 'tab' => 'widget',
938 ],
939 'easy_gallery' => [
940 'icon' => 'easyelIcon-marquee-logo',
941 'title' => 'Simple Gallery',
942 'description' => 'Gallery',
943 'demo_url' => 'https://wpeasyelements.com/simple-gallery/',
944 'docx_url' => 'https://wpeasyelements.com/docs/simple-gallery/',
945 'is_pro' => false,
946 'tab' => 'widget',
947 ],
948 'image_gallery_filter' => [
949 'icon' => 'easyelIcon-filterable-gallery',
950 'title' => 'Filterable Gallery',
951 'description' => 'filterable Gallery',
952 'demo_url' => 'https://wpeasyelements.comsimple-gallery/',
953 'docx_url' => 'https://wpeasyelements.comdocs/simple-gallery/',
954 'is_pro' => true,
955 'tab' => 'widget',
956 ],
957 'portfolio_pro' => [
958 'icon' => 'easyelIcon-marquee-logo',
959 'title' => 'Portfolio',
960 'description' => 'Portfolio',
961 'demo_url' => 'https://wpeasyelements.comportfolio/',
962 'docx_url' => 'https://wpeasyelements.comdocs/portfolio/',
963 'is_pro' => true,
964 'tab' => 'widget',
965 ],
966 'protected_content' => [
967 'icon' => 'easyelIcon-protected-content',
968 'title' => 'Protected Content',
969 'description' => 'This Widget is protected content',
970 'demo_url' => 'https://wpeasyelements.comprotected-content/',
971 'docx_url' => 'https://wpeasyelements.comdocs/protected-content/',
972 'is_pro' => true,
973 'tab' => 'widget',
974 ],
975 'advanced_search' => [
976 'icon' => 'easyelIcon-advance-search',
977 'title' => 'Advanced Search',
978 'description' => 'This Widget is advanced search',
979 'demo_url' => 'https://wpeasyelements.comprotected-content/',
980 'docx_url' => 'https://wpeasyelements.comdocs/protected-content/',
981 'is_pro' => true,
982 'tab' => 'widget',
983 ],
984 'enable_image_hover_effect' => [
985 'icon' => 'easyelIcon-marquee-logo',
986 'title' => 'Image Hover Effect',
987 'description' => 'This Widget is image hover effect',
988 'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
989 'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
990 'is_pro' => true,
991 'tab' => 'widget',
992 ],
993 'hr_image_scroll' => [
994 'icon' => 'easyelIcon-image-horizontal-scroll',
995 'title' => 'ScrollTrigger',
996 'description' => 'This Widget is image hover effect',
997 'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
998 'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
999 'is_pro' => true,
1000 'group' => 'Animations',
1001 'tab' => 'widget',
1002 ],
1003 'archive_post' => [
1004 'icon' => 'easyelIcon-post-grid',
1005 'title' => 'Archive Post',
1006 'description' => 'This Widget is archive post widget',
1007 'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
1008 'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
1009 'is_pro' => false,
1010 'tab' => 'widget',
1011 ],
1012 'counter' => [
1013 'icon' => 'eicon-counter',
1014 'title' => 'Counter',
1015 'description' => 'This is a widget that counts up.',
1016 'demo_url' => 'https://wpeasyelements.com/counter/',
1017 'docx_url' => 'https://wpeasyelements.com/docs/counter/',
1018 'is_pro' => false,
1019 'tab' => 'widget',
1020 ],
1021 'countdown' => [
1022 'icon' => 'eicon-countdown',
1023 'title' => 'Countdown',
1024 'description' => 'This is a countdown widget.',
1025 'demo_url' => 'https://wpeasyelements.com/countdown/',
1026 'docx_url' => 'https://wpeasyelements.com/docs/countdown/',
1027 'is_pro' => false,
1028 'tab' => 'widget',
1029 ]
1030 ];
1031
1032 return apply_filters( 'easyel_available_widgets', $widgets );
1033 }
1034
1035 /**
1036 * Admin page HTML
1037 */
1038 function easyel_custom_fonts_page_html() {
1039 if ( ! current_user_can( 'manage_options' ) ) return;
1040
1041 if ( ! defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) || ! EASY_ELEMENTS_PRO_ACTIVE ) {
1042 echo '<div class="wrap"><h1>' . esc_html__( 'Upload Custom Fonts', 'easy-elements' ) . '</h1>';
1043 echo '<p>' . esc_html__( 'This feature is available in Easy Elements Pro. Please install and activate the Pro version to use it.', 'easy-elements' ) . '</p>';
1044 echo '</div>';
1045 return;
1046 }
1047
1048 easyel_pro_custom_fonts_page();
1049 }
1050
1051 /**
1052 * Hide admin notices on the Easy Elements dashboard page.
1053 */
1054 function easyel_hide_admin_notices() {
1055 $screen = get_current_screen();
1056
1057 if ( $screen && 'toplevel_page_easy-elements-dashboard' === $screen->id ) {
1058
1059 $custom_css = '
1060 /* Hide all common notices */
1061 .notice,
1062 .updated,
1063 .error,
1064 .update-nag,
1065 .notice-success,
1066 .notice-error,
1067 .notice-warning {
1068 display: none !important;
1069 }
1070
1071 /* But allow EasyEL notice */
1072 .easyel-promo-notice {
1073 display: block !important;
1074 }
1075 ';
1076
1077 $handle = 'easyel-admin-hide-notices';
1078 wp_register_style( $handle, false, [], EASYELEMENTS_VER );
1079 wp_enqueue_style( $handle );
1080 wp_add_inline_style( $handle, $custom_css );
1081 }
1082 }
1083 }
1084
1085 // Initialize the plugin
1086 Easyel_Elements::get_instance();