PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.6.1
Shortcodes and extra features for Phlox theme v2.6.1
2.17.22 2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / class-auxin-elementor-core-elements.php
auxin-elements / includes / elementor Last commit date
controls 6 years ago modules 6 years ago widgets 6 years ago class-auxin-elementor-core-elements.php 6 years ago
class-auxin-elementor-core-elements.php
794 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor;
3
4
5 /**
6 * Auxin Elementor Elements
7 *
8 * Custom Elementor extension.
9 *
10 *
11 * @package Auxin
12 * @license LICENSE.txt
13 * @author averta
14 * @link http://phlox.pro/
15 * @copyright (c) 2010-2020 averta
16 */
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit; // Exit if accessed directly.
20 }
21
22 /**
23 * Main Auxin Elementor Elements Class
24 *
25 * The main class that initiates and runs the plugin.
26 *
27 * @since 1.0.0
28 */
29 final class Elements {
30
31 /**
32 * Plugin Version
33 *
34 * @since 1.0.0
35 *
36 * @var string The plugin version.
37 */
38 const VERSION = '1.0.0';
39
40 /**
41 * Minimum Elementor Version
42 *
43 * @since 1.0.0
44 *
45 * @var string Minimum Elementor version required to run the plugin.
46 */
47 const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
48
49 /**
50 * Minimum PHP Version
51 *
52 * @since 1.0.0
53 *
54 * @var string Minimum PHP version required to run the plugin.
55 */
56 const MINIMUM_PHP_VERSION = '5.4.0';
57
58 /**
59 * Default elementor dir path
60 *
61 * @since 1.0.0
62 *
63 * @var string The defualt path to elementor dir on this plugin.
64 */
65 private $dir_path = '';
66
67 /**
68 * Instance
69 *
70 * @since 1.0.0
71 *
72 * @access private
73 * @static
74 *
75 * @var Auxin_Elementor_Core_Elements The single instance of the class.
76 */
77 private static $_instance = null;
78
79 /**
80 * Instance
81 *
82 * Ensures only one instance of the class is loaded or can be loaded.
83 *
84 * @since 1.0.0
85 *
86 * @access public
87 * @static
88 *
89 * @return Auxin_Elementor_Core_Elements An instance of the class.
90 */
91 public static function instance() {
92 if ( is_null( self::$_instance ) ) {
93 self::$_instance = new self();
94 }
95 return self::$_instance;
96 }
97
98 /**
99 * Constructor
100 *
101 * @since 1.0.0
102 *
103 * @access public
104 */
105 public function __construct() {
106 add_action( 'plugins_loaded', array( $this, 'init' ) );
107 }
108
109 /**
110 * Initialize the plugin
111 *
112 * Load the plugin only after Elementor (and other plugins) are loaded.
113 *
114 * Fired by `plugins_loaded` action hook.
115 *
116 * @since 1.0.0
117 *
118 * @access public
119 */
120 public function init() {
121
122 // Check if Elementor installed and activated
123 if ( ! did_action( 'elementor/loaded' ) ) {
124 return;
125 }
126
127 // Check for required Elementor version
128 if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {
129 add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) );
130 return;
131 }
132
133 // Check for required PHP version
134 if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) {
135 add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) );
136 return;
137 }
138
139 // Define elementor dir path
140 $this->dir_path = AUXELS_INC_DIR . '/elementor';
141
142 // Include core files
143 $this->includes();
144
145 // Add required hooks
146 $this->hooks();
147 }
148
149 /**
150 * Include Files
151 *
152 * Load required core files.
153 *
154 * @since 1.0.0
155 *
156 * @access public
157 */
158 public function includes() {
159 $this->load_modules();
160 }
161
162 /**
163 * Add hooks
164 *
165 * Add required hooks for extending the Elementor.
166 *
167 * @since 1.0.0
168 *
169 * @access public
170 */
171 public function hooks() {
172
173 // Register controls, widgets, and categories
174 add_action( 'elementor/elements/categories_registered' , [ $this, 'register_categories' ] );
175 add_action( 'elementor/widgets/widgets_registered' , [ $this, 'register_widgets' ] );
176 add_action( 'elementor/controls/controls_registered' , [ $this, 'register_controls' ] );
177
178 // Register Widget Styles
179 add_action( 'elementor/frontend/after_enqueue_styles' , [ $this, 'widget_styles' ] );
180
181 // Register Widget Scripts
182 add_action( 'elementor/frontend/after_register_scripts', [ $this, 'widget_scripts' ] );
183
184 // Register Admin Scripts
185 add_action( 'elementor/editor/before_enqueue_scripts' , [ $this, 'editor_scripts' ] );
186
187 // Register additional font icons
188 add_filter('elementor/icons_manager/additional_tabs' , [ $this, 'add_auxin_font_icons' ] );
189
190 // Change options on auxin load
191 add_action( 'auxin_admin_loaded' , [ $this, 'auxin_admin_loaded' ] );
192
193 // Flush CSS cache on auxin theme or plugin update
194 add_action( 'auxin_updated' , [ $this, 'clear_cache' ] );
195 }
196
197 /**
198 * Register widgets
199 *
200 * Register all auxin widgets which are in widgets list.
201 *
202 * @access public
203 */
204 public function register_widgets( $widgets_manager ) {
205
206 $widgets = [
207
208 /* Dynamic Elements
209 /*-------------------------------------*/
210 '10' => [
211 'file' => $this->dir_path . '/widgets/recent-posts-grid-carousel.php',
212 'class' => 'Elements\RecentPostsGridCarousel'
213 ],
214 '20' => [
215 'file' => $this->dir_path . '/widgets/recent-posts-masonry.php',
216 'class' => 'Elements\RecentPostsMasonry'
217 ],
218 '30' => [
219 'file' => $this->dir_path . '/widgets/recent-posts-land-style.php',
220 'class' => 'Elements\RecentPostsLand'
221 ],
222 '40' => [
223 'file' => $this->dir_path . '/widgets/recent-posts-timeline.php',
224 'class' => 'Elements\RecentPostsTimeline'
225 ],
226 '50' => [
227 'file' => $this->dir_path . '/widgets/recent-posts-tiles.php',
228 'class' => 'Elements\RecentPostsTiles'
229 ],
230 '60' => [
231 'file' => $this->dir_path . '/widgets/recent-posts-tiles-carousel.php',
232 'class' => 'Elements\RecentPostsTilesCarousel'
233 ],
234 '70' => [
235 'file' => $this->dir_path . '/widgets/recent-products.php',
236 'class' => 'Elements\RecentProducts'
237 ],
238
239 '80' => [
240 'file' => $this->dir_path . '/widgets/recent-comments.php',
241 'class' => 'Elements\RecentComments'
242 ],
243
244 /* General Elements
245 /*-------------------------------------*/
246 '88' => [
247 'file' => $this->dir_path . '/widgets/heading-modern.php',
248 'class' => 'Elements\ModernHeading'
249 ],
250 '89' => [
251 'file' => $this->dir_path . '/widgets/icon.php',
252 'class' => 'Elements\Icon'
253 ],
254 '90' => [
255 'file' => $this->dir_path . '/widgets/image.php',
256 'class' => 'Elements\Image'
257 ],
258 '100' => [
259 'file' => $this->dir_path . '/widgets/gallery.php',
260 'class' => 'Elements\Gallery'
261 ],
262 '105' => [
263 'file' => $this->dir_path . '/widgets/text.php',
264 'class' => 'Elements\Text'
265 ],
266 '110' => [
267 'file' => $this->dir_path . '/widgets/divider.php',
268 'class' => 'Elements\Divider'
269 ],
270 '115' => [
271 'file' => $this->dir_path . '/widgets/button.php',
272 'class' => 'Elements\Button'
273 ],
274 '120' => [
275 'file' => $this->dir_path . '/widgets/accordion.php',
276 'class' => 'Elements\Accordion'
277 ],
278 '125' => [
279 'file' => $this->dir_path . '/widgets/tabs.php',
280 'class' => 'Elements\Tabs'
281 ],
282 '130' => [
283 'file' => $this->dir_path . '/widgets/audio.php',
284 'class' => 'Elements\Audio'
285 ],
286 '140' => [
287 'file' => $this->dir_path . '/widgets/video.php',
288 'class' => 'Elements\Video'
289 ],
290 '145' => [
291 'file' => $this->dir_path . '/widgets/quote.php',
292 'class' => 'Elements\Quote'
293 ],
294 '150' => [
295 'file' => $this->dir_path . '/widgets/testimonial.php',
296 'class' => 'Elements\Testimonial'
297 ],
298 '155' => [
299 'file' => $this->dir_path . '/widgets/contact-form.php',
300 'class' => 'Elements\ContactForm'
301 ],
302 '160' => [
303 'file' => $this->dir_path . '/widgets/contact-box.php',
304 'class' => 'Elements\ContactBox'
305 ],
306 '165' => [
307 'file' => $this->dir_path . '/widgets/touch-slider.php',
308 'class' => 'Elements\TouchSlider'
309 ],
310 '170' => [
311 'file' => $this->dir_path . '/widgets/before-after.php',
312 'class' => 'Elements\BeforeAfter'
313 ],
314 '175' => [
315 'file' => $this->dir_path . '/widgets/staff.php',
316 'class' => 'Elements\Staff'
317 ],
318 '180' => [
319 'file' => $this->dir_path . '/widgets/gmap.php',
320 'class' => 'Elements\Gmap'
321 ],
322 '185' => [
323 'file' => $this->dir_path . '/widgets/custom-list.php',
324 'class' => 'Elements\CustomList'
325 ],
326 '190' => [
327 'file' => $this->dir_path . '/widgets/mailchimp.php',
328 'class' => 'Elements\MailChimp'
329 ],
330 '200' => [
331 'file' => $this->dir_path . '/widgets/theme-elements/current-time.php',
332 'class' => 'Elements\Theme_Elements\Current_Time'
333 ],
334 '205' => [
335 'file' => $this->dir_path . '/widgets/theme-elements/search.php',
336 'class' => 'Elements\Theme_Elements\SearchBox'
337 ],
338 '210' => [
339 'file' => $this->dir_path . '/widgets/theme-elements/site-title.php',
340 'class' => 'Elements\Theme_Elements\SiteTitle'
341 ],
342 '215' => [
343 'file' => $this->dir_path . '/widgets/theme-elements/menu.php',
344 'class' => 'Elements\Theme_Elements\MenuBox'
345 ],
346 '220' => [
347 'file' => $this->dir_path . '/widgets/theme-elements/logo.php',
348 'class' => 'Elements\Theme_Elements\Logo'
349 ],
350 '225' => [
351 'file' => $this->dir_path . '/widgets/carousel-navigation.php',
352 'class' => 'Elements\CarouselNavigation'
353 ],
354 '230' => [
355 'file' => $this->dir_path . '/widgets/theme-elements/copyright.php',
356 'class' => 'Elements\Theme_Elements\Copyright'
357 ],
358 '235' => [
359 'file' => $this->dir_path . '/widgets/svg.php',
360 'class' => 'Elements\Simple__SVG'
361 ],
362 '240' => [
363 'file' => $this->dir_path . '/widgets/theme-elements/modern-search.php',
364 'class' => 'Elements\Theme_Elements\ModernSearch'
365 ],
366 '245' => [
367 'file' => $this->dir_path . '/widgets/theme-elements/breadcrumbs.php',
368 'class' => 'Elements\Theme_Elements\Breadcrumbs'
369 ],
370 '250' => [
371 'file' => $this->dir_path . '/widgets/modern-button.php',
372 'class' => 'Elements\ModernButton'
373 ],
374 '255' => [
375 'file' => $this->dir_path . '/widgets/responsive-table.php',
376 'class' => 'Elements\ResponsiveTable'
377 ]
378 ];
379
380 if ( class_exists('WooCommerce') ) {
381 $widgets['195'] = [
382 'file' => $this->dir_path . '/widgets/theme-elements/shopping-cart.php',
383 'class' => 'Elements\Theme_Elements\Shopping_Cart'
384 ];
385 }
386
387 // sort the widgets by priority number
388 ksort( $widgets );
389
390 // making the list of widgets filterable
391 $widgets = apply_filters( 'auxin/core_elements/elementor/widgets_list', $widgets, $widgets_manager );
392
393 foreach ( $widgets as $widget ) {
394 if( ! empty( $widget['file'] ) && ! empty( $widget['class'] ) ){
395 include_once( $widget['file'] );
396 if( class_exists( $widget['class'] ) ){
397 $class_name = $widget['class'];
398 } elseif( class_exists( __NAMESPACE__ . '\\' . $widget['class'] ) ){
399 $class_name = __NAMESPACE__ . '\\' . $widget['class'];
400 } else {
401 auxin_error( sprintf( __('Element class "%s" not found.', 'auxin-elements' ), $class_name ) );
402 continue;
403 }
404 $widgets_manager->register_widget_type( new $class_name() );
405 }
406 }
407 }
408
409 /**
410 * Load Modules
411 *
412 * Load all auxin elementor modules.
413 *
414 * @since 1.0.0
415 *
416 * @access public
417 */
418 private function load_modules() {
419
420 $modules = array(
421 array(
422 'file' => $this->dir_path . '/modules/theme-builder/classes/locations-manager.php',
423 'class' => 'Modules\ThemeBuilder\Classes\Locations_Manager',
424 'instance' => false
425 ),
426 array(
427 'file' => $this->dir_path . '/modules/theme-builder/classes/preview-manager.php',
428 'class' => 'Modules\ThemeBuilder\Classes\Preview_Manager',
429 'instance' => false
430 ),
431 array(
432 'file' => $this->dir_path . '/modules/theme-builder/module.php',
433 'class' => 'Modules\ThemeBuilder\Module'
434 ),
435 array(
436 'file' => $this->dir_path . '/modules/theme-builder/theme-page-document.php',
437 'class' => 'Modules\ThemeBuilder\Theme_Document',
438 'instance' => false
439 ),
440 array(
441 'file' => $this->dir_path . '/modules/query-control/module.php',
442 'class' => 'Modules\QueryControl\Module'
443 ),
444 array(
445 'file' => $this->dir_path . '/modules/common.php',
446 'class' => 'Modules\Common'
447 ),
448 array(
449 'file' => $this->dir_path . '/modules/section.php',
450 'class' => 'Modules\Section'
451 ),
452 array(
453 'file' => $this->dir_path . '/modules/column.php',
454 'class' => 'Modules\Column'
455 ),
456 array(
457 'file' => $this->dir_path . '/modules/documents/header.php',
458 'class' => 'Modules\Documents\Header'
459 ),
460 array(
461 'file' => $this->dir_path . '/modules/documents/footer.php',
462 'class' => 'Modules\Documents\Footer'
463 ),
464 array(
465 'file' => $this->dir_path . '/modules/templates-types-manager.php',
466 'class' => 'Modules\Templates_Types_Manager'
467 )
468 );
469
470 if( is_admin() ){
471 $modules[] = [
472 'file' => $this->dir_path . '/modules/settings/base/manager.php',
473 'class' => 'Settings\Base\Manager',
474 'instance' => false
475 ];
476 $modules[] = [
477 'file' => $this->dir_path . '/modules/settings/general/manager.php',
478 'class' => 'Settings\General\Manager'
479 ];
480 $modules[] = [
481 'file' => $this->dir_path . '/modules/settings/page/manager.php',
482 'class' => 'Settings\Page\Manager'
483 ];
484 }
485
486 foreach ( $modules as $module ) {
487 if( ! empty( $module['file'] ) && ! empty( $module['class'] ) ){
488 include_once( $module['file'] );
489
490 if( isset( $module['instance'] ) ) {
491 continue;
492 }
493
494 if( class_exists( __NAMESPACE__ . '\\' . $module['class'] ) ){
495 $class_name = __NAMESPACE__ . '\\' . $module['class'];
496 } else {
497 auxin_error( sprintf( __('Module class "%s" not found.', 'auxin-elements' ), $class_name ) );
498 continue;
499 }
500 new $class_name();
501 }
502 }
503 }
504
505
506 /**
507 * Register controls
508 *
509 * @since 1.0.0
510 *
511 * @access public
512 */
513 public function register_controls( $controls_manager ) {
514
515 $controls = array(
516 'aux-visual-select' => array(
517 'file' => $this->dir_path . '/controls/visual-select.php',
518 'class' => 'Controls\Control_Visual_Select',
519 'type' => 'single'
520 ),
521 'aux-media' => array(
522 'file' => $this->dir_path . '/controls/media-select.php',
523 'class' => 'Controls\Control_Media_Select',
524 'type' => 'single'
525 ),
526 'aux-icon' => array(
527 'file' => $this->dir_path . '/controls/icon-select.php',
528 'class' => 'Controls\Control_Icon_Select',
529 'type' => 'single'
530 ),
531 'aux-featured-color' => array(
532 'file' => $this->dir_path . '/controls/featured-color.php',
533 'class' => 'Controls\Control_Featured_Color',
534 'type' => 'single'
535 )
536 );
537
538 foreach ( $controls as $control_type => $control_info ) {
539 if( ! empty( $control_info['file'] ) && ! empty( $control_info['class'] ) ){
540 include_once( $control_info['file'] );
541
542 if( class_exists( $control_info['class'] ) ){
543 $class_name = $control_info['class'];
544 } elseif( class_exists( __NAMESPACE__ . '\\' . $control_info['class'] ) ){
545 $class_name = __NAMESPACE__ . '\\' . $control_info['class'];
546 }
547
548 if( $control_info['type'] === 'group' ){
549 $controls_manager->add_group_control( $control_type, new $class_name() );
550 } else {
551 $controls_manager->register_control( $control_type, new $class_name() );
552 }
553
554 }
555 }
556 }
557
558 /**
559 * Register categories
560 *
561 * @since 1.0.0
562 *
563 * @access public
564 */
565 public function register_categories( $categories_manager ) {
566
567 $categories_manager->add_category(
568 'auxin-core',
569 array(
570 'title' => sprintf( __( '%s - General', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
571 'icon' => 'eicon-font',
572 )
573 );
574
575 $categories_manager->add_category(
576 'auxin-pro',
577 array(
578 'title' => sprintf( __( '%s - Featured', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
579 'icon' => 'eicon-font',
580 )
581 );
582
583 $categories_manager->add_category(
584 'auxin-dynamic',
585 array(
586 'title' => sprintf( __( '%s - Posts', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
587 'icon' => 'eicon-font',
588 )
589 );
590
591 $categories_manager->add_category(
592 'auxin-portfolio',
593 array(
594 'title' => sprintf( __( '%s - Portfolio', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
595 'icon' => 'eicon-font',
596 )
597 );
598
599 }
600
601 /**
602 * Enqueue styles.
603 *
604 * Enqueue all the frontend styles.
605 *
606 * @since 1.0.0
607 *
608 * @access public
609 */
610 public function widget_styles() {
611 // Add auxin custom styles
612 wp_enqueue_style( 'auxin-elementor-widgets' , AUXELS_ADMIN_URL . '/assets/css/elementor-widgets.css' );
613 wp_enqueue_style( 'wp-mediaelement' );
614
615 }
616
617 /**
618 * Enqueue scripts.
619 *
620 * Enqueue all the frontend scripts.
621 *
622 * @since 1.0.0
623 *
624 * @access public
625 */
626 public function widget_scripts() {
627 $dependencies = array('jquery', 'auxin-plugins');
628
629 if( defined('MSWP_AVERTA_VERSION') ){
630 $dependencies[] = 'masterslider-core';
631 }
632 wp_enqueue_script( 'auxin-elementor-widgets' , AUXELS_ADMIN_URL . '/assets/js/elementor/widgets.js' , $dependencies, AUXELS_VERSION, TRUE );
633 wp_enqueue_script('wp-mediaelement');
634 }
635
636 /**
637 * Enqueue scripts.
638 *
639 * Enqueue all the backend scripts.
640 *
641 * @since 1.0.0
642 *
643 * @access public
644 */
645 public function editor_scripts() {
646 // Auxin Icons
647 wp_register_style( 'auxin-front-icon' , THEME_URL . 'css/auxin-icon.css', null, AUXELS_VERSION );
648 // Elementor Custom Style
649 wp_register_style( 'auxin-elementor-editor', AUXELS_ADMIN_URL . '/assets/css/elementor-editor.css', array(), AUXELS_VERSION );
650 // Elementor Custom Scripts
651 wp_register_script( 'auxin-elementor-editor', AUXELS_ADMIN_URL . '/assets/js/elementor/editor.js', array( 'jquery-elementor-select2' ), AUXELS_VERSION );
652 }
653
654 /**
655 * Admin notice
656 *
657 * Warning when the site doesn't have a minimum required Elementor version.
658 *
659 * @since 1.0.0
660 *
661 * @access public
662 */
663 public function admin_notice_minimum_elementor_version() {
664
665 if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
666
667 $message = sprintf(
668 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'auxin-elements' ),
669 '<strong>' . esc_html__( 'Phlox Core Elements', 'auxin-elements' ) . '</strong>',
670 '<strong>' . esc_html__( 'Elementor', 'auxin-elements' ) . '</strong>',
671 self::MINIMUM_ELEMENTOR_VERSION
672 );
673
674 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
675 }
676
677 /**
678 * Admin notice
679 *
680 * Warning when the site doesn't have a minimum required PHP version.
681 *
682 * @since 1.0.0
683 *
684 * @access public
685 */
686 public function admin_notice_minimum_php_version() {
687
688 if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
689
690 $message = sprintf(
691 /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
692 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'auxin-elements' ),
693 '<strong>' . esc_html__( 'Phlox Core Elements', 'auxin-elements' ) . '</strong>',
694 '<strong>' . esc_html__( 'PHP', 'auxin-elements' ) . '</strong>',
695 self::MINIMUM_PHP_VERSION
696 );
697
698 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
699 }
700
701 /**
702 * Set options on auxin load
703 *
704 * Change The Default Settings of Elementor.
705 *
706 * @since 1.0.0
707 *
708 * @access public
709 */
710 public function auxin_admin_loaded() {
711
712 if( false !== auxin_get_transient( 'auxin_has_checked_to_disable_default_elementor_colors_fonts' ) ){
713 return;
714 }
715
716 if( ! function_exists( 'auxin_get_options' ) ){
717 return;
718 }
719
720 // If it's a fresh installation
721 if( ! auxin_get_options() ){
722 update_option( 'elementor_disable_color_schemes', 'yes' );
723 update_option( 'elementor_disable_typography_schemes', 'yes' );
724 update_option( 'elementor_page_title_selector', '.page-title' );
725 update_option( 'elementor_allow_svg', '1' );
726 }
727
728 auxin_set_transient( 'auxin_has_checked_to_disable_default_elementor_colors_fonts', THEME_VERSION, 3 * YEAR_IN_SECONDS );
729 }
730
731 /**
732 * Add Auxin Icons to elementor icons pack
733 *
734 * @param array $tabs Icon library tabs
735 * @return void
736 */
737 public function add_auxin_font_icons( $tabs = [] ) {
738
739 // Phlox Icon set 1
740 $icons = Auxin()->Font_Icons->get_icons_list( 'fontastic' );
741
742 foreach ( $icons as $icon ) {
743 $icons_list[] = str_replace( '.auxicon-', '', $icon->classname );
744 }
745
746 $tabs['auxicon'] = [
747 'name' => 'auxin-front-icon',
748 'label' => __( 'Phlox Icons - Set 1', 'auxin-elements' ),
749 'url' => THEME_URL . 'css/auxin-icon.css',
750 'enqueue' => [ THEME_URL . 'css/auxin-icon.css' ],
751 'prefix' => 'auxicon-',
752 'displayPrefix' => 'auxicon',
753 'labelIcon' => 'auxicon-sun',
754 'ver' => '1.0.0',
755 'icons' => $icons_list
756 ];
757
758 // Phlox Icon set 2
759 $icons_v2 = Auxin()->Font_Icons->get_icons_list( 'auxicon2' );
760
761 foreach ( $icons_v2 as $icon ) {
762 $icons_list2[] = str_replace( '.auxicon2-', '', $icon->classname );
763 }
764
765 $tabs['auxicon2'] = [
766 'name' => 'auxin-front-icon2',
767 'label' => __( 'Phlox Icons - Set 2', 'auxin-elements' ),
768 'url' => THEME_URL . 'css/auxin-icon.css',
769 'enqueue' => [ THEME_URL . 'css/auxin-icon.css' ],
770 'prefix' => 'auxicon2-',
771 'displayPrefix' => 'auxicon2',
772 'labelIcon' => 'auxicon-sun',
773 'ver' => '1.0.0',
774 'icons' => $icons_list2
775 ];
776
777 return $tabs;
778 }
779
780 /**
781 * Clear cache.
782 *
783 * Delete all meta containing files data. And delete the actual
784 * files from the upload directory.
785 *
786 */
787 public function clear_cache(){
788 //\Elementor\Plugin::$instance->files_manager->clear_cache();
789 }
790
791 }
792
793 Elements::instance();
794