PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 1.0.4
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v1.0.4
3.0.59 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 3.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.6 3.0.7 3.0.8 3.0.9
essential-classy-addons-for-elementor / classes / widgets-passing-lists.php
essential-classy-addons-for-elementor / classes Last commit date
class-helper.php 4 years ago class-loader.php 4 years ago class-panel-options.php 4 years ago widgets-passing-lists.php 4 years ago
widgets-passing-lists.php
127 lines
1 <?php
2 namespace EcafeAddons;
3
4 if (!defined('ABSPATH')) {
5 exit;
6 } // Exit if accessed directly
7
8 if ( ! class_exists( 'ecafeWidgetsPassed' ) ) {
9
10 /**
11 * Ecafe widgets passed
12 */
13 class ecafeWidgetsPassed {
14
15 private static $instance = null;
16
17 /**
18 * Constructor
19 */
20 private function __construct() {
21 $this->init();
22 }
23
24 public function init() {
25 add_action( 'elementor/widgets/widgets_registered', array($this, 'addWidgets' ) );
26 add_action( 'elementor/controls/controls_registered', array( $this, 'add_controls' ), 10 );
27 }
28
29 /**
30 * Add Controls Extensions
31 */
32 public function add_controls( $controls_manager ) {
33 $grouped_control = array(
34 'ecafe-widgets-extras' => 'Ecafe_Widgets_Extras',
35 );
36 foreach ( $grouped_control as $control_id => $class_name ) {
37 if ( $this->extensionWidgets( $control_id, true ) ) {
38 new $class_name();
39 }
40 }
41 }
42
43 /**
44 * Add widgets
45 */
46 public function addWidgets( $widgetsexEcutive ) {
47
48 $combined = array(
49 'ecafe-accordion' => '\EcafeAddons\Widgets\Ecafe_Accordion',
50 'ecafe-adv-text-block' => '\EcafeAddons\Widgets\Ecafe_Adv_Text_Block',
51 'ecafe-business-hours' => '\EcafeAddons\Widgets\Ecafe_Business_Hours',
52 'ecafe-button' => '\EcafeAddons\Widgets\Ecafe_Button',
53 'ecafe-changelog' => '\EcafeAddons\Widgets\Ecafe_Changelog',
54 'ecafe-darkmode-styling' => '\EcafeAddons\Widgets\Ecafe_Darkmode_Styling',
55 'ecafe-chart' => '\EcafeAddons\Widgets\Ecafe_Chart',
56 'ecafe-image-hover-effect' => '\EcafeAddons\Widgets\Ecafe_Image_Hover_Effect',
57 'ecafe-infobox' => '\EcafeAddons\Widgets\Ecafe_Infobox',
58 'ecafe-social-icons' => '\EcafeAddons\Widgets\Ecafe_Social_Icons',
59 'ecafe-title' => '\EcafeAddons\Widgets\Ecafe_Title',
60 'ecafe-grid-post-listing' => '\EcafeAddons\Widgets\Ecafe_Grid_Post_Listing',
61 'ecafe-lottie' => '\EcafeAddons\Widgets\Ecafe_Lottie',
62 'ecafe-marketing-link' => '\EcafeAddons\Widgets\Ecafe_Marketing_Link',
63 'ecafe-tabs' => '\EcafeAddons\Widgets\Ecafe_Tabs',
64 );
65
66 $optionFetch=\EcafeHelper::ecafeGetOption('general','widgetsload');
67 if(!empty($optionFetch)){
68 array_push($optionFetch, "ecafe-widgets");
69 foreach ( $combined as $widgetId => $className ) {
70 if(in_array($widgetId,$optionFetch)){
71 if ( $this->carryWidgets( $widgetId, true ) ) {
72 $widgetsexEcutive->register_widget_type( new $className() );
73 }
74 }
75 }
76 }
77 }
78
79 /**
80 * Carry widgets
81 */
82 public function carryWidgets( $widgetId, $combined = false ) {
83
84 $filename = sprintf('element/widgets/'.$widgetId.'.php');
85
86 if ( ! file_exists( ECAFE_PATH.$filename ) ) {
87 return false;
88 }
89
90 require ECAFE_PATH.$filename;
91
92 return true;
93 }
94
95 /**
96 * Extension Includes
97 */
98 public function extensionWidgets( $widgetId, $combined = false ) {
99
100 $filename = sprintf('element/extension/'.$widgetId.'.php');
101
102 if ( ! file_exists( ECAFE_PATH.$filename ) ) {
103 return false;
104 }
105
106 require ECAFE_PATH.$filename;
107
108 return true;
109 }
110
111 /**
112 * Instance fetch
113 */
114 public static function instanceFetch( $handlers = array() ) {
115
116 if ( null == self::$instance ) {
117 self::$instance = new self( $handlers );
118 }
119 return self::$instance;
120 }
121 }
122
123 }
124
125 function ecafeWidgetsPassed() {
126 return ecafeWidgetsPassed::instanceFetch();
127 }