# windpress/3.0.6/src/Integration/Elementor/Main.php

WindPress – Tailwind CSS integration for WordPress, version 3.0.6. 54 lines.

- Page: https://pluginprobe.com/plugins/windpress/3.0.6/code/src/Integration/Elementor/Main.php
- Raw: https://pluginprobe.com/plugins/windpress/3.0.6/raw/src/Integration/Elementor/Main.php
- Modified: 2024-08-28T04:00:22+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/windpress/3.0.6/code/src/Integration/Elementor/Main.php#L10-L20`.

```php
<?php

/*
 * This file is part of the WindPress package.
 *
 * (c) Joshua Gugun Siagian <suabahasa@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
declare (strict_types=1);
namespace WindPress\WindPress\Integration\Elementor;

use WindPress\WindPress\Integration\IntegrationInterface;
use WindPress\WindPress\Utils\Config;
/**
 * @author Joshua Gugun Siagian <suabahasa@gmail.com>
 */
class Main implements IntegrationInterface
{
    public function __construct()
    {
        \add_filter('f!windpress/core/cache:compile.providers', fn(array $providers): array => $this->register_provider($providers));
        if ($this->is_enabled()) {
            \add_filter('f!windpress/core/runtime:append_header.exclude_admin', fn(bool $is_exclude_admin): bool => $this->is_exclude_admin($is_exclude_admin));
        }
    }
    public function get_name() : string
    {
        return 'elementor';
    }
    public function is_enabled() : bool
    {
        return (bool) \apply_filters('f!windpress/integration/elementor:enabled', Config::get(\sprintf('integration.%s.enabled', $this->get_name()), \true));
    }
    public function register_provider(array $providers) : array
    {
        $providers[] = ['id' => $this->get_name(), 'name' => 'Elementor', 'description' => 'Elementor integration', 'callback' => \WindPress\WindPress\Integration\Elementor\Compile::class, 'enabled' => $this->is_enabled()];
        return $providers;
    }
    public function is_exclude_admin(bool $is_exclude_admin) : bool
    {
        if ($is_exclude_admin || !$this->is_preview()) {
            return $is_exclude_admin;
        }
        return $this->is_preview();
    }
    public function is_preview() : bool
    {
        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is not a form submission
        return isset($_GET['elementor-preview']) && $_GET['elementor-preview'];
    }
}

```
