PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 4.1.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v4.1.0
4.1.0 4.0.9 4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / components / slots / class-slot-render-utility.php
superb-blocks / src / components / slots Last commit date
class-css-blocks-base-slot.php 2 weeks ago class-css-blocks-export-selected-slot.php 2 weeks ago class-css-blocks-export-single-slot.php 2 weeks ago class-css-blocks-target-slot.php 2 weeks ago class-premium-option-wrapper.php 2 weeks ago class-premium-slot.php 2 weeks ago class-slot-render-utility.php 2 weeks ago
class-slot-render-utility.php
86 lines
1 <?php
2
3 namespace SuperbAddons\Components\Slots;
4
5 defined('ABSPATH') || exit();
6
7 class SlotRenderUtility
8 {
9 private static $AllowedHTML = array(
10 'div' => array(
11 'data-type' => true,
12 'class' => array(),
13 'id' => array(),
14 'style' => array(),
15 ),
16 'select' => array(
17 'class' => array(),
18 'id' => array(),
19 'name' => array(),
20 'placeholder' => array(),
21 'multiple' => array(),
22 'style' => array(),
23 ),
24 'option' => array(
25 'value' => array(),
26 'selected' => array(),
27 ),
28 'input' => array(
29 'class' => array(),
30 'id' => array(),
31 'name' => array(),
32 'type' => array(),
33 'value' => array(),
34 'checked' => array(),
35 'style' => array(),
36 'data-action' => true,
37 ),
38 'iframe' => array(
39 'class' => array(),
40 'src' => array(),
41 'loading' => array(),
42 'data-src' => true,
43 'data-noreload' => true,
44 'data-status' => true,
45 'data-id' => true,
46 ),
47 'svg' => array(
48 'xmlns' => true,
49 'width' => true,
50 'height' => true,
51 'viewbox' => true,
52 'fill' => true,
53 'class' => array(),
54 'aria-hidden' => true,
55 'focusable' => true,
56 ),
57 'path' => array(
58 'd' => true,
59 'fill' => true,
60 'fill-rule' => true,
61 'clip-rule' => true,
62 ),
63 );
64
65 public static function Render($contentCallback)
66 {
67 add_filter('safe_style_css', function ($styles) {
68 if (!in_array('display', $styles)) {
69 $styles[] = 'display';
70 }
71
72 return $styles;
73 });
74 ob_start();
75 ($contentCallback)();
76 $content = ob_get_clean();
77 echo wp_kses(
78 $content,
79 array_merge(
80 wp_kses_allowed_html('post'),
81 self::$AllowedHTML
82 )
83 );
84 }
85 }
86