PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.13
Shortcodes and extra features for Phlox theme v2.5.13
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
790 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
194 /**
195 * Register widgets
196 *
197 * Register all auxin widgets which are in widgets list.
198 *
199 * @access public
200 */
201 public function register_widgets( $widgets_manager ) {
202
203 $widgets = [
204
205 /* Dynamic Elements
206 /*-------------------------------------*/
207 '10' => [
208 'file' => $this->dir_path . '/widgets/recent-posts-grid-carousel.php',
209 'class' => 'Elements\RecentPostsGridCarousel'
210 ],
211 '20' => [
212 'file' => $this->dir_path . '/widgets/recent-posts-masonry.php',
213 'class' => 'Elements\RecentPostsMasonry'
214 ],
215 '30' => [
216 'file' => $this->dir_path . '/widgets/recent-posts-land-style.php',
217 'class' => 'Elements\RecentPostsLand'
218 ],
219 '40' => [
220 'file' => $this->dir_path . '/widgets/recent-posts-timeline.php',
221 'class' => 'Elements\RecentPostsTimeline'
222 ],
223 '50' => [
224 'file' => $this->dir_path . '/widgets/recent-posts-tiles.php',
225 'class' => 'Elements\RecentPostsTiles'
226 ],
227 '60' => [
228 'file' => $this->dir_path . '/widgets/recent-posts-tiles-carousel.php',
229 'class' => 'Elements\RecentPostsTilesCarousel'
230 ],
231 '70' => [
232 'file' => $this->dir_path . '/widgets/recent-products.php',
233 'class' => 'Elements\RecentProducts'
234 ],
235
236 '80' => [
237 'file' => $this->dir_path . '/widgets/recent-comments.php',
238 'class' => 'Elements\RecentComments'
239 ],
240
241 /* General Elements
242 /*-------------------------------------*/
243 '88' => [
244 'file' => $this->dir_path . '/widgets/heading-modern.php',
245 'class' => 'Elements\ModernHeading'
246 ],
247 '89' => [
248 'file' => $this->dir_path . '/widgets/icon.php',
249 'class' => 'Elements\Icon'
250 ],
251 '90' => [
252 'file' => $this->dir_path . '/widgets/image.php',
253 'class' => 'Elements\Image'
254 ],
255 '100' => [
256 'file' => $this->dir_path . '/widgets/gallery.php',
257 'class' => 'Elements\Gallery'
258 ],
259 '105' => [
260 'file' => $this->dir_path . '/widgets/text.php',
261 'class' => 'Elements\Text'
262 ],
263 '110' => [
264 'file' => $this->dir_path . '/widgets/divider.php',
265 'class' => 'Elements\Divider'
266 ],
267 '115' => [
268 'file' => $this->dir_path . '/widgets/button.php',
269 'class' => 'Elements\Button'
270 ],
271 '120' => [
272 'file' => $this->dir_path . '/widgets/accordion.php',
273 'class' => 'Elements\Accordion'
274 ],
275 '125' => [
276 'file' => $this->dir_path . '/widgets/tabs.php',
277 'class' => 'Elements\Tabs'
278 ],
279 '130' => [
280 'file' => $this->dir_path . '/widgets/audio.php',
281 'class' => 'Elements\Audio'
282 ],
283 '140' => [
284 'file' => $this->dir_path . '/widgets/video.php',
285 'class' => 'Elements\Video'
286 ],
287 '145' => [
288 'file' => $this->dir_path . '/widgets/quote.php',
289 'class' => 'Elements\Quote'
290 ],
291 '150' => [
292 'file' => $this->dir_path . '/widgets/testimonial.php',
293 'class' => 'Elements\Testimonial'
294 ],
295 '155' => [
296 'file' => $this->dir_path . '/widgets/contact-form.php',
297 'class' => 'Elements\ContactForm'
298 ],
299 '160' => [
300 'file' => $this->dir_path . '/widgets/contact-box.php',
301 'class' => 'Elements\ContactBox'
302 ],
303 '165' => [
304 'file' => $this->dir_path . '/widgets/touch-slider.php',
305 'class' => 'Elements\TouchSlider'
306 ],
307 '170' => [
308 'file' => $this->dir_path . '/widgets/before-after.php',
309 'class' => 'Elements\BeforeAfter'
310 ],
311 '175' => [
312 'file' => $this->dir_path . '/widgets/staff.php',
313 'class' => 'Elements\Staff'
314 ],
315 '180' => [
316 'file' => $this->dir_path . '/widgets/gmap.php',
317 'class' => 'Elements\Gmap'
318 ],
319 '185' => [
320 'file' => $this->dir_path . '/widgets/custom-list.php',
321 'class' => 'Elements\CustomList'
322 ],
323 '190' => [
324 'file' => $this->dir_path . '/widgets/mailchimp.php',
325 'class' => 'Elements\MailChimp'
326 ],
327 '200' => [
328 'file' => $this->dir_path . '/widgets/theme-elements/current-time.php',
329 'class' => 'Elements\Theme_Elements\Current_Time'
330 ],
331 '205' => [
332 'file' => $this->dir_path . '/widgets/theme-elements/search.php',
333 'class' => 'Elements\Theme_Elements\SearchBox'
334 ],
335 '210' => [
336 'file' => $this->dir_path . '/widgets/theme-elements/site-title.php',
337 'class' => 'Elements\Theme_Elements\SiteTitle'
338 ],
339 '215' => [
340 'file' => $this->dir_path . '/widgets/theme-elements/menu.php',
341 'class' => 'Elements\Theme_Elements\MenuBox'
342 ],
343 '220' => [
344 'file' => $this->dir_path . '/widgets/theme-elements/logo.php',
345 'class' => 'Elements\Theme_Elements\Logo'
346 ],
347 '225' => [
348 'file' => $this->dir_path . '/widgets/carousel-navigation.php',
349 'class' => 'Elements\CarouselNavigation'
350 ],
351 '230' => [
352 'file' => $this->dir_path . '/widgets/theme-elements/copyright.php',
353 'class' => 'Elements\Theme_Elements\Copyright'
354 ],
355 '235' => [
356 'file' => $this->dir_path . '/widgets/svg.php',
357 'class' => 'Elements\Simple__SVG'
358 ],
359 '240' => [
360 'file' => $this->dir_path . '/widgets/theme-elements/modern-search.php',
361 'class' => 'Elements\Theme_Elements\ModernSearch'
362 ],
363 '245' => [
364 'file' => $this->dir_path . '/widgets/theme-elements/breadcrumbs.php',
365 'class' => 'Elements\Theme_Elements\Breadcrumbs'
366 ],
367 '250' => [
368 'file' => $this->dir_path . '/widgets/modern-button.php',
369 'class' => 'Elements\ModernButton'
370 ],
371 '255' => [
372 'file' => $this->dir_path . '/widgets/responsive-table.php',
373 'class' => 'Elements\ResponsiveTable'
374 ]
375 ];
376
377 if ( class_exists('WooCommerce') ) {
378 $widgets['195'] = [
379 'file' => $this->dir_path . '/widgets/theme-elements/shopping-cart.php',
380 'class' => 'Elements\Theme_Elements\Shopping_Cart'
381 ];
382 }
383
384 // sort the widgets by priority number
385 ksort( $widgets );
386
387 // making the list of widgets filterable
388 $widgets = apply_filters( 'auxin/core_elements/elementor/widgets_list', $widgets, $widgets_manager );
389
390 foreach ( $widgets as $widget ) {
391 if( ! empty( $widget['file'] ) && ! empty( $widget['class'] ) ){
392 include_once( $widget['file'] );
393 if( class_exists( $widget['class'] ) ){
394 $class_name = $widget['class'];
395 } elseif( class_exists( __NAMESPACE__ . '\\' . $widget['class'] ) ){
396 $class_name = __NAMESPACE__ . '\\' . $widget['class'];
397 } else {
398 auxin_error( sprintf( __('Element class "%s" not found.', 'auxin-elements' ), $class_name ) );
399 continue;
400 }
401 $widgets_manager->register_widget_type( new $class_name() );
402 }
403 }
404 }
405
406 /**
407 * Load Modules
408 *
409 * Load all auxin elementor modules.
410 *
411 * @since 1.0.0
412 *
413 * @access public
414 */
415 private function load_modules() {
416
417 $modules = array(
418 array(
419 'file' => $this->dir_path . '/modules/theme-builder/classes/locations-manager.php',
420 'class' => 'Modules\ThemeBuilder\Classes\Locations_Manager',
421 'instance' => false
422 ),
423 array(
424 'file' => $this->dir_path . '/modules/theme-builder/classes/preview-manager.php',
425 'class' => 'Modules\ThemeBuilder\Classes\Preview_Manager',
426 'instance' => false
427 ),
428 array(
429 'file' => $this->dir_path . '/modules/theme-builder/module.php',
430 'class' => 'Modules\ThemeBuilder\Module'
431 ),
432 array(
433 'file' => $this->dir_path . '/modules/theme-builder/theme-page-document.php',
434 'class' => 'Modules\ThemeBuilder\Theme_Document',
435 'instance' => false
436 ),
437 array(
438 'file' => $this->dir_path . '/modules/query-control/module.php',
439 'class' => 'Modules\QueryControl\Module'
440 ),
441 array(
442 'file' => $this->dir_path . '/modules/common.php',
443 'class' => 'Modules\Common'
444 ),
445 array(
446 'file' => $this->dir_path . '/modules/section.php',
447 'class' => 'Modules\Section'
448 ),
449 array(
450 'file' => $this->dir_path . '/modules/column.php',
451 'class' => 'Modules\Column'
452 ),
453 array(
454 'file' => $this->dir_path . '/modules/documents/header.php',
455 'class' => 'Modules\Documents\Header'
456 ),
457 array(
458 'file' => $this->dir_path . '/modules/documents/footer.php',
459 'class' => 'Modules\Documents\Footer'
460 ),
461 array(
462 'file' => $this->dir_path . '/modules/templates-types-manager.php',
463 'class' => 'Modules\Templates_Types_Manager'
464 )
465 );
466
467 if( is_admin() ){
468 $modules[] = [
469 'file' => $this->dir_path . '/modules/settings/base/manager.php',
470 'class' => 'Settings\Base\Manager',
471 'instance' => false
472 ];
473 $modules[] = [
474 'file' => $this->dir_path . '/modules/settings/general/manager.php',
475 'class' => 'Settings\General\Manager'
476 ];
477 $modules[] = [
478 'file' => $this->dir_path . '/modules/settings/page/manager.php',
479 'class' => 'Settings\Page\Manager'
480 ];
481 }
482
483 foreach ( $modules as $module ) {
484 if( ! empty( $module['file'] ) && ! empty( $module['class'] ) ){
485 include_once( $module['file'] );
486
487 if( isset( $module['instance'] ) ) {
488 continue;
489 }
490
491 if( class_exists( __NAMESPACE__ . '\\' . $module['class'] ) ){
492 $class_name = __NAMESPACE__ . '\\' . $module['class'];
493 } else {
494 auxin_error( sprintf( __('Module class "%s" not found.', 'auxin-elements' ), $class_name ) );
495 continue;
496 }
497 new $class_name();
498 }
499 }
500 }
501
502
503 /**
504 * Register controls
505 *
506 * @since 1.0.0
507 *
508 * @access public
509 */
510 public function register_controls( $controls_manager ) {
511
512 $controls = array(
513 'aux-visual-select' => array(
514 'file' => $this->dir_path . '/controls/visual-select.php',
515 'class' => 'Controls\Control_Visual_Select',
516 'type' => 'single'
517 ),
518 'aux-media' => array(
519 'file' => $this->dir_path . '/controls/media-select.php',
520 'class' => 'Controls\Control_Media_Select',
521 'type' => 'single'
522 ),
523 'aux-icon' => array(
524 'file' => $this->dir_path . '/controls/icon-select.php',
525 'class' => 'Controls\Control_Icon_Select',
526 'type' => 'single'
527 ),
528 'aux-featured-color' => array(
529 'file' => $this->dir_path . '/controls/featured-color.php',
530 'class' => 'Controls\Control_Featured_Color',
531 'type' => 'single'
532 )
533 );
534
535 foreach ( $controls as $control_type => $control_info ) {
536 if( ! empty( $control_info['file'] ) && ! empty( $control_info['class'] ) ){
537 include_once( $control_info['file'] );
538
539 if( class_exists( $control_info['class'] ) ){
540 $class_name = $control_info['class'];
541 } elseif( class_exists( __NAMESPACE__ . '\\' . $control_info['class'] ) ){
542 $class_name = __NAMESPACE__ . '\\' . $control_info['class'];
543 }
544
545 if( $control_info['type'] === 'group' ){
546 $controls_manager->add_group_control( $control_type, new $class_name() );
547 } else {
548 $controls_manager->register_control( $control_type, new $class_name() );
549 }
550
551 }
552 }
553 }
554
555 /**
556 * Register categories
557 *
558 * @since 1.0.0
559 *
560 * @access public
561 */
562 public function register_categories( $categories_manager ) {
563
564 $categories_manager->add_category(
565 'auxin-core',
566 array(
567 'title' => sprintf( __( '%s - General', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
568 'icon' => 'eicon-font',
569 )
570 );
571
572 $categories_manager->add_category(
573 'auxin-pro',
574 array(
575 'title' => sprintf( __( '%s - Featured', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
576 'icon' => 'eicon-font',
577 )
578 );
579
580 $categories_manager->add_category(
581 'auxin-dynamic',
582 array(
583 'title' => sprintf( __( '%s - Posts', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
584 'icon' => 'eicon-font',
585 )
586 );
587
588 $categories_manager->add_category(
589 'auxin-portfolio',
590 array(
591 'title' => sprintf( __( '%s - Portfolio', 'auxin-elements' ), '<strong>'. THEME_NAME_I18N .'</strong>' ),
592 'icon' => 'eicon-font',
593 )
594 );
595
596 }
597
598 /**
599 * Enqueue styles.
600 *
601 * Enqueue all the frontend styles.
602 *
603 * @since 1.0.0
604 *
605 * @access public
606 */
607 public function widget_styles() {
608 // Add auxin custom styles
609 wp_enqueue_style( 'auxin-elementor-widgets' , AUXELS_ADMIN_URL . '/assets/css/elementor-widgets.css' );
610 wp_enqueue_style( 'wp-mediaelement' );
611
612 // Enqueue header template styles in header
613 if( $header_template_style = auxin_get_option( 'site_elementor_header_template' ) ){
614 $css_file = new \Elementor\Core\Files\CSS\Post( $header_template_style );
615 $css_file->enqueue();
616 }
617
618 if( $footer_template_style = auxin_get_option( 'site_elementor_footer_template' ) ){
619 $css_file = new \Elementor\Core\Files\CSS\Post( $footer_template_style );
620 $css_file->enqueue();
621 }
622 }
623
624 /**
625 * Enqueue scripts.
626 *
627 * Enqueue all the frontend scripts.
628 *
629 * @since 1.0.0
630 *
631 * @access public
632 */
633 public function widget_scripts() {
634 $dependencies = array('jquery', 'auxin-plugins');
635
636 if( defined('MSWP_AVERTA_VERSION') ){
637 $dependencies[] = 'masterslider-core';
638 }
639 wp_enqueue_script( 'auxin-elementor-widgets' , AUXELS_ADMIN_URL . '/assets/js/elementor/widgets.js' , $dependencies, AUXELS_VERSION, TRUE );
640 wp_enqueue_script('wp-mediaelement');
641 }
642
643 /**
644 * Enqueue scripts.
645 *
646 * Enqueue all the backend scripts.
647 *
648 * @since 1.0.0
649 *
650 * @access public
651 */
652 public function editor_scripts() {
653 // Auxin Icons
654 wp_register_style( 'auxin-front-icon' , THEME_URL . 'css/auxin-icon.css', null, AUXELS_VERSION );
655 // Elementor Custom Style
656 wp_register_style( 'auxin-elementor-editor', AUXELS_ADMIN_URL . '/assets/css/elementor-editor.css', array(), AUXELS_VERSION );
657 // Elementor Custom Scripts
658 wp_register_script( 'auxin-elementor-editor', AUXELS_ADMIN_URL . '/assets/js/elementor/editor.js', array( 'jquery-elementor-select2' ), AUXELS_VERSION );
659 }
660
661 /**
662 * Admin notice
663 *
664 * Warning when the site doesn't have a minimum required Elementor version.
665 *
666 * @since 1.0.0
667 *
668 * @access public
669 */
670 public function admin_notice_minimum_elementor_version() {
671
672 if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
673
674 $message = sprintf(
675 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'auxin-elements' ),
676 '<strong>' . esc_html__( 'Phlox Core Elements', 'auxin-elements' ) . '</strong>',
677 '<strong>' . esc_html__( 'Elementor', 'auxin-elements' ) . '</strong>',
678 self::MINIMUM_ELEMENTOR_VERSION
679 );
680
681 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
682 }
683
684 /**
685 * Admin notice
686 *
687 * Warning when the site doesn't have a minimum required PHP version.
688 *
689 * @since 1.0.0
690 *
691 * @access public
692 */
693 public function admin_notice_minimum_php_version() {
694
695 if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
696
697 $message = sprintf(
698 /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
699 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'auxin-elements' ),
700 '<strong>' . esc_html__( 'Phlox Core Elements', 'auxin-elements' ) . '</strong>',
701 '<strong>' . esc_html__( 'PHP', 'auxin-elements' ) . '</strong>',
702 self::MINIMUM_PHP_VERSION
703 );
704
705 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
706 }
707
708 /**
709 * Set options on auxin load
710 *
711 * Change The Default Settings of Elementor.
712 *
713 * @since 1.0.0
714 *
715 * @access public
716 */
717 public function auxin_admin_loaded() {
718
719 if( false !== auxin_get_transient( 'auxin_has_checked_to_disable_default_elementor_colors_fonts' ) ){
720 return;
721 }
722
723 if( ! function_exists( 'auxin_get_options' ) ){
724 return;
725 }
726
727 // If it's a fresh installation
728 if( ! auxin_get_options() ){
729 update_option( 'elementor_disable_color_schemes', 'yes' );
730 update_option( 'elementor_disable_typography_schemes', 'yes' );
731 update_option( 'elementor_page_title_selector', '.page-title' );
732 update_option( 'elementor_allow_svg', '1' );
733 }
734
735 auxin_set_transient( 'auxin_has_checked_to_disable_default_elementor_colors_fonts', THEME_VERSION, 3 * YEAR_IN_SECONDS );
736 }
737
738 /**
739 * Add Auxin Icons to elementor icons pack
740 *
741 * @param array $tabs Icon library tabs
742 * @return void
743 */
744 public function add_auxin_font_icons( $tabs = [] ) {
745
746 // Phlox Icon set 1
747 $icons = Auxin()->Font_Icons->get_icons_list( 'fontastic' );
748
749 foreach ( $icons as $icon ) {
750 $icons_list[] = str_replace( '.auxicon-', '', $icon->classname );
751 }
752
753 $tabs['auxicon'] = [
754 'name' => 'auxicon',
755 'label' => __( 'Phlox Icons - Set 1', 'auxin-elements' ),
756 'url' => THEME_URL . 'css/auxin-icon.css',
757 'enqueue' => [ THEME_URL . 'css/auxin-icon.css' ],
758 'prefix' => 'auxicon-',
759 'displayPrefix' => 'auxicon',
760 'labelIcon' => 'auxicon-sun',
761 'ver' => '1.0.0',
762 'icons' => $icons_list
763 ];
764
765 // Phlox Icon set 2
766 $icons_v2 = Auxin()->Font_Icons->get_icons_list( 'auxicon2' );
767
768 foreach ( $icons_v2 as $icon ) {
769 $icons_list2[] = str_replace( '.auxicon2-', '', $icon->classname );
770 }
771
772 $tabs['auxicon2'] = [
773 'name' => 'auxicon2',
774 'label' => __( 'Phlox Icons - Set 2', 'auxin-elements' ),
775 'url' => THEME_URL . 'css/auxin-icon.css',
776 'enqueue' => [ THEME_URL . 'css/auxin-icon.css' ],
777 'prefix' => 'auxicon2-',
778 'displayPrefix' => 'auxicon2',
779 'labelIcon' => 'auxicon-sun',
780 'ver' => '1.0.0',
781 'icons' => $icons_list2
782 ];
783
784 return $tabs;
785 }
786
787 }
788
789 Elements::instance();
790