PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
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 6 months ago AmeliaCatalogBookingElementorWidget.php 2 weeks ago AmeliaCatalogElementorWidget.php 6 months ago AmeliaEventsCalendarBookingElementorWidget.php 2 weeks ago AmeliaEventsElementorWidget.php 2 weeks ago AmeliaEventsListBookingButtonElementorWidget.php 2 weeks ago AmeliaEventsListBookingElementorWidget.php 2 weeks ago AmeliaStepBookingButtonElementorWidget.php 1 month ago AmeliaStepBookingElementorWidget.php 2 weeks ago ElementorBlock.php 2 weeks ago ElementorSharedShortcodeWidget.php 2 weeks ago
ElementorBlock.php
90 lines
1 <?php
2
3 /**
4 * @copyright © Melograno Ventures. 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\AmeliaStepBookingButtonElementorWidget;
13 use Elementor\AmeliaCatalogBookingElementorWidget;
14 use Elementor\AmeliaCatalogElementorWidget;
15 use Elementor\AmeliaEventsElementorWidget;
16 use Elementor\AmeliaEventsListBookingElementorWidget;
17 use Elementor\AmeliaEventsListBookingButtonElementorWidget;
18 use Elementor\Plugin;
19
20 /**
21 * Class ElementorBlock
22 *
23 * @package AmeliaBooking\Infrastructure\WP\Elementor
24 */
25 class ElementorBlock
26 {
27 protected static $instance;
28
29 public static function get_instance()
30 {
31 if (!isset(static::$instance)) {
32 static::$instance = new static();
33 }
34
35 return static::$instance;
36 }
37
38 protected function __construct()
39 {
40 add_action('elementor/editor/before_enqueue_scripts', [$this, 'widget_styles']);
41 add_action('elementor/widgets/register', [$this, 'register_widgets']);
42 add_action('elementor/frontend/after_enqueue_styles', [$this, 'widget_styles']);
43 add_action('elementor/elements/categories_registered', [$this, 'register_widget_categories']);
44 }
45
46 public function includes()
47 {
48 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/ElementorSharedShortcodeWidget.php');
49 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaStepBookingElementorWidget.php');
50 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaStepBookingButtonElementorWidget.php');
51 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaCatalogBookingElementorWidget.php');
52 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaBookingElementorWidget.php');
53 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaCatalogElementorWidget.php');
54 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaEventsElementorWidget.php');
55 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaEventsListBookingElementorWidget.php');
56 require_once(AMELIA_PATH . '/src/Infrastructure/WP/Elementor/AmeliaEventsListBookingButtonElementorWidget.php');
57 }
58
59 public function register_widgets()
60 {
61 $this->includes();
62 Plugin::instance()->widgets_manager->register(new AmeliaStepBookingElementorWidget());
63 Plugin::instance()->widgets_manager->register(new AmeliaStepBookingButtonElementorWidget());
64 Plugin::instance()->widgets_manager->register(new AmeliaCatalogBookingElementorWidget());
65 Plugin::instance()->widgets_manager->register(new AmeliaBookingElementorWidget());
66 Plugin::instance()->widgets_manager->register(new AmeliaCatalogElementorWidget());
67 Plugin::instance()->widgets_manager->register(new AmeliaEventsElementorWidget());
68 Plugin::instance()->widgets_manager->register(new AmeliaEventsListBookingElementorWidget());
69 Plugin::instance()->widgets_manager->register(new AmeliaEventsListBookingButtonElementorWidget());
70 }
71
72 public function widget_styles()
73 {
74 wp_register_style('amelia-elementor-widget-font', AMELIA_URL . 'public/css/frontend/elementor.css', array(), AMELIA_VERSION);
75 wp_enqueue_style('amelia-elementor-widget-font');
76 }
77
78 public function register_widget_categories($elements_manager)
79 {
80 $elements_manager->add_category(
81 'amelia-elementor',
82 [
83 'title' => 'Amelia',
84 'icon' => 'amelia-logo',
85 ],
86 1
87 );
88 }
89 }
90