PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.11
Booking for Appointments and Events Calendar – Amelia v1.2.11
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 2 years ago AmeliaCatalogBookingElementorWidget.php 1 year ago AmeliaCatalogElementorWidget.php 2 years ago AmeliaEventsCalendarBookingElementorWidget.php 1 year ago AmeliaEventsElementorWidget.php 2 years ago AmeliaEventsListBookingElementorWidget.php 2 years ago AmeliaStepBookingElementorWidget.php 2 years ago ElementorBlock.php 2 years ago
ElementorBlock.php
81 lines
1 <?php
2 /**
3 * @copyright © TMS-Plugins. All rights reserved.
4 * @licence See LICENCE.md for license details.
5 */
6
7 namespace AmeliaBooking\Infrastructure\WP\Elementor;
8
9 use Elementor\AmeliaBookingElementorWidget;
10 use Elementor\AmeliaStepBookingElementorWidget;
11 use Elementor\AmeliaCatalogBookingElementorWidget;
12 use Elementor\AmeliaCatalogElementorWidget;
13 use Elementor\AmeliaEventsElementorWidget;
14 use Elementor\AmeliaEventsListBookingElementorWidget;
15 use Elementor\Plugin;
16
17 /**
18 * Class ElementorBlock
19 *
20 * @package AmeliaBooking\Infrastructure\WP\Elementor
21 */
22 class ElementorBlock
23 {
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 ], 1);
79 }
80
81 }