From 6a9160ab812ee7175f6f554a0d0c77e7f7b87034 Mon Sep 17 00:00:00 2001 From: m1ga Date: Thu, 31 Mar 2022 20:37:29 +0200 Subject: [PATCH] fix for Elementor 3.6.1 --- modern-events-calendar-lite-details.php | 29 ++++++++----------------- widgets/EventContent.php | 7 ++---- widgets/EventDateControls.php | 8 +++---- widgets/EventDateEnd.php | 4 ---- widgets/EventDateStart.php | 3 --- widgets/EventOrganizer.php | 7 ++---- widgets/EventOrganizerImage.php | 3 --- widgets/EventPlace.php | 7 ++---- widgets/EventPlaceImage.php | 3 --- widgets/EventTitle.php | 8 ++----- 10 files changed, 21 insertions(+), 58 deletions(-) diff --git a/modern-events-calendar-lite-details.php b/modern-events-calendar-lite-details.php index 660120b..cda0c5d 100644 --- a/modern-events-calendar-lite-details.php +++ b/modern-events-calendar-lite-details.php @@ -3,7 +3,7 @@ * Plugin Name: Modern Events Calendar Lite - Detail pages * Plugin URI: https://github.com/m1ga/mec_lite_elementor * Description: Link to normal pages for Modern Events Calendar Lite event details and edit them with Elementor -* Version: 1.2 +* Version: 1.3 * Author: Michael Gangolf * Author URI: https://www.migaweb.de/ **/ @@ -84,25 +84,14 @@ function mec_set_detailpage() require_once(__DIR__ . '/widgets/EventOrganizer.php'); - if (version_compare(ELEMENTOR_VERSION, "3.5.0", '>')) { - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventTitle()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventDateStart()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventDateEnd()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventContent()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventPlace()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventPlaceImage()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventOrganizerImage()); - \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventOrganizer()); - } else { - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventTitle()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventDateStart()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventDateEnd()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventContent()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventPlace()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventPlaceImage()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventOrganizerImage()); - \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Elementor_Widget_MCE_EventOrganizer()); - } + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventTitle()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventDateStart()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventDateEnd()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventContent()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventPlace()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventPlaceImage()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventOrganizerImage()); + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor_Widget_MCE_EventOrganizer()); }); diff --git a/widgets/EventContent.php b/widgets/EventContent.php index 023308c..b60f045 100644 --- a/widgets/EventContent.php +++ b/widgets/EventContent.php @@ -44,8 +44,8 @@ protected function _register_controls() 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__content' => 'color: {{VALUE}}', @@ -68,7 +68,4 @@ protected function render() } } - protected function _content_template() - { - } } diff --git a/widgets/EventDateControls.php b/widgets/EventDateControls.php index 1d4dd2c..0058f80 100644 --- a/widgets/EventDateControls.php +++ b/widgets/EventDateControls.php @@ -104,8 +104,8 @@ 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__datetime' => 'color: {{VALUE}}', @@ -119,8 +119,8 @@ 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__time' => 'color: {{VALUE}}', diff --git a/widgets/EventDateEnd.php b/widgets/EventDateEnd.php index 81effd4..505f47c 100644 --- a/widgets/EventDateEnd.php +++ b/widgets/EventDateEnd.php @@ -33,8 +33,4 @@ protected function render() $var_get2 = 'mec_end_day_seconds'; require("EventDateRender.php"); } - - protected function _content_template() - { - } } diff --git a/widgets/EventDateStart.php b/widgets/EventDateStart.php index 4227e87..d21c7ac 100644 --- a/widgets/EventDateStart.php +++ b/widgets/EventDateStart.php @@ -34,7 +34,4 @@ protected function render() require("EventDateRender.php"); } - protected function _content_template() - { - } } diff --git a/widgets/EventOrganizer.php b/widgets/EventOrganizer.php index 627595d..1231c56 100644 --- a/widgets/EventOrganizer.php +++ b/widgets/EventOrganizer.php @@ -45,8 +45,8 @@ protected function _register_controls() 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__organizer' => 'color: {{VALUE}}', @@ -78,7 +78,4 @@ protected function render() } } - protected function _content_template() - { - } } diff --git a/widgets/EventOrganizerImage.php b/widgets/EventOrganizerImage.php index 063de70..0c6b554 100644 --- a/widgets/EventOrganizerImage.php +++ b/widgets/EventOrganizerImage.php @@ -42,7 +42,4 @@ protected function render() } } - protected function _content_template() - { - } } diff --git a/widgets/EventPlace.php b/widgets/EventPlace.php index 26c2dcb..06392e3 100644 --- a/widgets/EventPlace.php +++ b/widgets/EventPlace.php @@ -73,8 +73,8 @@ protected function _register_controls() 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__location' => 'color: {{VALUE}}', @@ -106,7 +106,4 @@ protected function render() } } - protected function _content_template() - { - } } diff --git a/widgets/EventPlaceImage.php b/widgets/EventPlaceImage.php index 935115a..599a7ae 100644 --- a/widgets/EventPlaceImage.php +++ b/widgets/EventPlaceImage.php @@ -42,7 +42,4 @@ protected function render() } } - protected function _content_template() - { - } } diff --git a/widgets/EventTitle.php b/widgets/EventTitle.php index c7b9bf9..4af4fde 100644 --- a/widgets/EventTitle.php +++ b/widgets/EventTitle.php @@ -96,8 +96,8 @@ protected function _register_controls() 'label' => __('Title Color', 'mec_lite_dp'), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ - 'type' => \Elementor\Scheme_Color::get_type(), - 'value' => \Elementor\Scheme_Color::COLOR_1, + 'type' => \Elementor\Core\Schemes\Color::get_type(), + 'value' => \Elementor\Core\Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .event__title' => 'color: {{VALUE}}', @@ -116,8 +116,4 @@ protected function render() $id = $query[0]->ID; echo '<'.$settings['title_tag'].' class="event__title" style="text-align: ' . $settings['event_title_align'] . '; color: ' . $settings['event_title_color'] . '">'.get_the_title($id).''; } - - protected function _content_template() - { - } }