# acymailing/10.0.1/WpInit/Elementor.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 10.0.1. 43 lines.

- Page: https://pluginprobe.com/plugins/acymailing/10.0.1/code/WpInit/Elementor.php
- Raw: https://pluginprobe.com/plugins/acymailing/10.0.1/raw/WpInit/Elementor.php
- Modified: 2025-01-27T11:09:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/10.0.1/code/WpInit/Elementor.php#L10-L20`.

```php
<?php

namespace AcyMailing\WpInit;

class Elementor
{
    public function __construct()
    {
        add_action('elementor/editor/before_enqueue_scripts', [$this, 'addAcyScriptElementor']);
        add_action('elementor/widgets/register', [$this, 'registerWidgets']);
        add_action('elementor/elements/categories_registered', [$this, 'addWidgetCategories']);
        add_action('elementor_pro/init', [$this, 'addAcyFormAction']);
    }

    public function addAcyScriptElementor()
    {
        wp_enqueue_script('select2lib', ACYM_JS.'libraries/select2-full.min.js?v='.filemtime(ACYM_MEDIA.'js'.DS.'libraries'.DS.'select2-full.min.js'), ['jquery']);
        wp_enqueue_script('acym_script_widget_article_elementor', ACYM_JS.'widget.min.js?v='.time(), ['jquery', 'select2lib'], false, true);
        wp_enqueue_script('acymailing-compatibility-elementor', ACYM_JS.'libraries/elementor.min.js', [], false, true);
        wp_enqueue_style('acym_style_widget_article_elementor', ACYM_CSS.'libraries/elementor.min.css?v='.time());
    }

    public function registerWidgets()
    {
        include_once ACYM_WIDGETS.'subscriptionform'.DS.'elementor.php';
        \Elementor\Plugin::instance()->widgets_manager->register(new \acySubscriptionFormWidget());
    }

    public function addWidgetCategories($elements_manager)
    {
        $elements_manager->add_category('acymailing', [
            'title' => 'AcyMailing',
        ]);
    }

    public function addAcyFormAction()
    {
        $acymailing = new ElementorForm();
        \ElementorPro\Plugin::instance()->modules_manager->get_modules('forms')->add_form_action($acymailing->get_name(), $acymailing);
    }

}

```
