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