PluginProbe
Easy Hotel – Powerful Hotel Booking / 2.0.2
Easy Hotel – Powerful Hotel Booking v2.0.2
2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.9.9 1.9.8 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 All 110 releases
easy-hotel / public / includes / widgets / widgets.php

widgets.php in Easy Hotel – Powerful Hotel Booking 2.0.2, at public/includes/widgets/widgets.php

136 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3 final class Eshb_Elementor_Extension {
4 /**
5 * Instance
6 *
7 * @since 1.0.0
8 *
9 * @access private
10 * @static
11 *
12 * @var Elementor_Test_Extension The single instance of the class.
13 */
14 private static $_instance = null;
15
16 /**
17 * Instance
18 *
19 * Ensures only one instance of the class is loaded or can be loaded.
20 *
21 * @since 1.0.0
22 *
23 * @access public
24 * @static
25 *
26 * @return Elementor_Test_Extension An instance of the class.
27 */
28 public static function instance() {
29
30 if ( is_null( self::$_instance ) ) {
31 self::$_instance = new self();
32 }
33 return self::$_instance;
34
35 }
36
37 /**
38 * Constructor
39 *
40 * @since 1.0.0
41 *
42 * @access public
43 */
44 public function __construct() {
45 add_action( 'plugins_loaded', [ $this, 'init' ] );
46 }
47
48
49 /**
50 * Initialize the plugin
51 *
52 * Load the plugin only after Elementor (and other plugins) are loaded.
53 * Checks for basic plugin requirements, if one check fail don't continue,
54 * if all check have passed load the files required to run the plugin.
55 *
56 * Fired by `plugins_loaded` action hook.
57 *
58 * @since 1.0.0
59 *
60 * @access public
61 */
62 public function init() {
63
64 // Add Plugin actions
65 add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] );
66 add_action( 'elementor/elements/categories_registered', [ $this, 'add_category' ] );
67
68
69 $this->include_files();
70 }
71
72 public function include_files() {
73
74 }
75
76 public function add_category( $elements_manager ) {
77 $elements_manager->add_category(
78 'easy_hotel_category',
79 [
80 'title' => esc_html__('Easy Hotel', 'easy-hotel' ),
81 'icon' => esc_attr('fa fa-smile-o'),
82 ]
83 );
84 }
85
86 public function init_widgets() {
87
88 //Search Form
89 require_once(__DIR__ . '/search-form/search-form.php');
90 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Search_Widget());
91
92 //Booking Form
93 require_once(__DIR__ . '/booking-form/booking-form.php');
94 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Booking_Form_Widget());
95
96 //Availability Calendar
97 require_once(__DIR__ . '/availability-calendar/availability-calendar.php');
98 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Availability_Calendar_Widget());
99
100
101 //room grid
102 require_once(__DIR__ . '/room-grid/room-grid-widget.php');
103 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Room_Grid_Widget());
104
105 //room grid
106 require_once(__DIR__ . '/room-slider/room-slider-widget.php');
107 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Room_Slider_Widget());
108
109 //room gaallery
110 require_once(__DIR__ . '/room-gallery/room-gallery.php');
111 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Room_Gallery_Widget());
112
113 // room basic info
114 require_once(__DIR__ . '/room-basic-info/room-basic-info.php');
115 \Elementor\Plugin::instance()->widgets_manager->register(new \Eshb_Room_Basic_Info_Widget());
116
117 }
118 }
119 Eshb_Elementor_Extension::instance();
120
121 add_action( 'init', function() {
122 if( ! class_exists( '\Bricks\Elements' ) ) {
123 return; // Bricks is not active
124 }
125 $element_files = [
126 __DIR__ . '/bricks/room-gallery/room-gallery.php',
127 __DIR__ . '/bricks/room-grid/room-grid.php',
128 __DIR__ . '/bricks/room-slider/room-slider.php',
129 ];
130
131 foreach ( $element_files as $file ) {
132 \Bricks\Elements::register_element( $file );
133 }
134 }, 11 );
135
136