PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / trunk
MxChat – AI Chatbot & Content Generation for WordPress vtrunk
3.2.21 3.2.20 3.2.19 3.2.18 3.2.17 3.2.16 3.2.15 3.2.14 3.2.12 3.2.13 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 3.2.6 3.2.5 3.2.4 3.2.3 3.2.2 3.2.1 2.0.3 2.0.4 2.0.5 2.0.6 All 152 releases
mxchat-basic / includes / class-mxchat-elementor.php

class-mxchat-elementor.php in MxChat – AI Chatbot & Content Generation for WordPress trunk, at includes/class-mxchat-elementor.php

29 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit; // Exit if accessed directly
4 }
5
6 /**
7 * Elementor integration for the chatbot placement widget (plan 95dd1e, part 2).
8 *
9 * Registration happens ONLY inside Elementor's own `elementor/widgets/register`
10 * hook (Elementor >= 3.5): when Elementor is absent — or too old to fire that
11 * hook — nothing further loads, so there is no fatal and no ghost widget. The
12 * Widget_Base subclass lives in its own file required from the callback below,
13 * which is why this always-loaded file must never reference an Elementor class.
14 */
15 class MxChat_Elementor {
16
17 public static function init() {
18 add_action('elementor/widgets/register', array(__CLASS__, 'register_widget'));
19 }
20
21 /**
22 * @param \Elementor\Widgets_Manager $widgets_manager Passed by Elementor.
23 */
24 public static function register_widget($widgets_manager) {
25 require_once __DIR__ . '/class-mxchat-elementor-widget.php';
26 $widgets_manager->register(new MxChat_Elementor_Widget());
27 }
28 }
29