# swatchly/trunk/includes/Compatibility/Elementor.php

Swatchly – Product Variation Swatches for WooCommerce, version trunk. 42 lines.

- Page: https://pluginprobe.com/plugins/swatchly/trunk/code/includes/Compatibility/Elementor.php
- Raw: https://pluginprobe.com/plugins/swatchly/trunk/raw/includes/Compatibility/Elementor.php
- Modified: 2022-10-06T05:25:06+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/swatchly/trunk/code/includes/Compatibility/Elementor.php#L10-L20`.

```php
<?php
namespace Swatchly\Compatibility;

class Elementor {
    /**
     * Constructor.
     */
    public function __construct() {
        if( is_plugin_active('elementor/elementor.php') ){
            // for related products
            add_filter('wp_kses_allowed_html', array( $this, 'related_products_compatibility' ), 10, 2);
        }
    }

    public function related_products_compatibility( $allowedposttags, $context ){
        $allowedposttags['form'] = array(
            'id' => true,
            'name' => true,
            'class' => true,
            'data-*' => true,
            'current-image' => true
        );

        $allowedposttags['select'] = array(
            'id' => true,
            'name' => true,
            'class' => true,
            'data-*' => true,
        );
    
        $allowedposttags['option'] = array(
            'id' => true,
            'name' => true,
            'class' => true,
            'data-*' => true,
            'value' => true
        );
    
        return $allowedposttags;
    }
}

```
