| 1 |
<?php |
| 2 |
namespace Swatchly\Compatibility; |
| 3 |
|
| 4 |
class Elementor { |
| 5 |
/** |
| 6 |
* Constructor. |
| 7 |
*/ |
| 8 |
public function __construct() { |
| 9 |
if( is_plugin_active('elementor/elementor.php') ){ |
| 10 |
// for related products |
| 11 |
add_filter('wp_kses_allowed_html', array( $this, 'related_products_compatibility' ), 10, 2); |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
public function related_products_compatibility( $allowedposttags, $context ){ |
| 16 |
$allowedposttags['form'] = array( |
| 17 |
'id' => true, |
| 18 |
'name' => true, |
| 19 |
'class' => true, |
| 20 |
'data-*' => true, |
| 21 |
'current-image' => true |
| 22 |
); |
| 23 |
|
| 24 |
$allowedposttags['select'] = array( |
| 25 |
'id' => true, |
| 26 |
'name' => true, |
| 27 |
'class' => true, |
| 28 |
'data-*' => true, |
| 29 |
); |
| 30 |
|
| 31 |
$allowedposttags['option'] = array( |
| 32 |
'id' => true, |
| 33 |
'name' => true, |
| 34 |
'class' => true, |
| 35 |
'data-*' => true, |
| 36 |
'value' => true |
| 37 |
); |
| 38 |
|
| 39 |
return $allowedposttags; |
| 40 |
} |
| 41 |
} |
| 42 |
|