PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.31
Booking for Appointments and Events Calendar – Amelia v1.2.31
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Infrastructure / WP / Elementor / ElementorBlock.php
ameliabooking / src / Infrastructure / WP / Elementor Last commit date
AmeliaBookingElementorWidget.php 1 year ago AmeliaCatalogBookingElementorWidget.php 1 year ago AmeliaCatalogElementorWidget.php 1 year ago AmeliaEventsCalendarBookingElementorWidget.php 1 year ago AmeliaEventsElementorWidget.php 1 year ago AmeliaEventsListBookingElementorWidget.php 1 year ago AmeliaStepBookingElementorWidget.php 1 year ago ElementorBlock.php 1 year ago
ElementorBlock.php
83 lines
1 <?php
2
3 /**
4 * @copyright © TMS-Plugins. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace AmeliaBooking\Infrastructure\WP\Elementor;
9
10 use Elementor\AmeliaBookingElementorWidget;
11 use Elementor\AmeliaStepBookingElementorWidget;
12 use Elementor\AmeliaCatalogBookingElementorWidget;
13 use Elementor\AmeliaCatalogElementorWidget;
14 use Elementor\AmeliaEventsElementorWidget;
15 use Elementor\AmeliaEventsListBookingElementorWidget;
16 use Elementor\Plugin;
17
18 /**
19 * Class ElementorBlock
20 *
21 * @package AmeliaBooking\Infrastructure\WP\Elementor
22 */
23 class ElementorBlock
24 {
25 protected static $instance;
26
27 public static function get_instance()
28 {
29 if (!isset(static::$instance)) {
30 static::$instance = new static();
31 }
32
33 return static::$instance;
34 }
35
36 protected function __construct()
37 {
38 add_action('elementor/editor/before_enqueue_scripts', [$this, 'widget_styles']);
39 add_action('elementor/widgets/register', [$this, 'register_widgets']);
40 add_action('elementor/frontend/after_enqueue_styles', [$this, 'widget_styles']);
41 add_action('elementor/elements/categories_registered', [$this, 'register_widget_categories']);
42 }
43
44 public function includes()
45 {
46 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaStepBookingElementorWidget.php');
47 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaCatalogBookingElementorWidget.php');
48 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaBookingElementorWidget.php');
49 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaCatalogElementorWidget.php');
50 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaEventsElementorWidget.php');
51 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaEventsListBookingElementorWidget.php');
52 }
53
54 public function register_widgets()
55 {
56 $this->includes();
57 Plugin::instance()->widgets_manager->register(new AmeliaStepBookingElementorWidget());
58 Plugin::instance()->widgets_manager->register(new AmeliaCatalogBookingElementorWidget());
59 Plugin::instance()->widgets_manager->register(new AmeliaBookingElementorWidget());
60 Plugin::instance()->widgets_manager->register(new AmeliaCatalogElementorWidget());
61 Plugin::instance()->widgets_manager->register(new AmeliaEventsElementorWidget());
62 Plugin::instance()->widgets_manager->register(new AmeliaEventsListBookingElementorWidget());
63 }
64
65 public function widget_styles()
66 {
67 wp_register_style('amelia-elementor-widget-font', AMELIA_URL . 'public/css/frontend/elementor.css', array(), AMELIA_VERSION);
68 wp_enqueue_style('amelia-elementor-widget-font');
69 }
70
71 public function register_widget_categories($elements_manager)
72 {
73 $elements_manager->add_category(
74 'amelia-elementor',
75 [
76 'title' => 'Amelia',
77 'icon' => 'amelia-logo',
78 ],
79 1
80 );
81 }
82 }
83