PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.4
Wp Social Login and Register Social Counter v2.2.4
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / inc / elementor / elements.php
wp-social / inc / elementor Last commit date
widgets 3 years ago elements.php 5 years ago
elements.php
82 lines
1 <?php
2
3 namespace WP_Social\Inc\Elementor;
4
5 defined('ABSPATH') || exit;
6
7 /**
8 * Class Name : Elements - For configration elementtor widget for Fundrasing.
9 * Class Type : Normal class
10 *
11 * initiate all necessary classes, hooks, configs
12 *
13 * @since 1.0.0
14 * @access Public
15 */
16
17 class Elements {
18
19 private $active_widgets = ['share'];
20
21 private static $instance;
22
23 public function _init($load = true){
24 if($load){
25 if ( ! did_action( 'elementor/loaded' ) ) {
26 return false;
27 }
28 // categories
29 add_action('elementor/elements/categories_registered', [$this, '_elementor_widget_resister']);
30
31 //call widget
32 add_action( 'elementor/widgets/widgets_registered', [$this, 'register_widget']);
33 }
34 }
35
36 /**
37 * Method Name: _elementor_widget_resister
38 * Details : Register categories of Elementor Controls
39 *
40 * @since 1.0.0
41 * @access public
42 */
43 public function _elementor_widget_resister( $widgets_manager ){
44 \Elementor\Plugin::$instance->elements_manager->add_category(
45 'xs-wpsocial-login',
46 [
47 'title' =>esc_html__( 'Social Login', 'wp-social' ),
48 'icon' => 'fa fa-plug',
49 ],
50 1
51 );
52 }
53
54 /**
55 * Method Name: register_widget
56 * Details : Register widget of Elementor Controls
57 *
58 * @since 1.0.0
59 * @access public
60 */
61
62 public function register_widget( ){
63 foreach($this->active_widgets as $widget){
64 $files = plugin_dir_path(__FILE__).'widgets/'.$widget.'.php';
65 if( file_exists( $files) ){
66 require_once $files;
67 $class_name = '\Elementor\Wps_'. ucfirst($widget);
68 \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new $class_name());
69 }
70 }
71 }
72
73 public static function instance(){
74 if (!self::$instance){
75 self::$instance = new self();
76 }
77 return self::$instance;
78 }
79
80 }
81
82