PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 3.5.2
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v3.5.2
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 / data / utils / class-allowed-template-html-util.php
superb-blocks / src / data / utils Last commit date
wizard 1 year ago class-addons-template-util.php 1 year ago class-allowed-template-html-util.php 1 year ago class-base-exception.php 1 year ago class-cache-constants.php 1 year ago class-cache-exception.php 1 year ago class-key-exception.php 1 year ago class-keytypes.php 1 year ago class-option-exception.php 1 year ago class-quiet-skin.php 1 year ago class-request-exception.php 1 year ago class-script-translations.php 1 year ago class-settings-exception.php 1 year ago class-theme-installer-exception.php 1 year ago class-theme-installer.php 1 year ago
class-allowed-template-html-util.php
80 lines
1 <?php
2
3 namespace SuperbAddons\Data\Utils;
4
5 defined('ABSPATH') || exit();
6
7 class AllowedTemplateHTMLUtil
8 {
9 public static function enable_safe_styles()
10 {
11 add_filter("safe_style_css", array(__CLASS__, "_add_display_safe_style_css"));
12 }
13
14 public static function disable_safe_styles()
15 {
16 remove_filter("safe_style_css", array(__CLASS__, "_add_display_safe_style_css"));
17 }
18
19 public static function get_allowed_html()
20 {
21 // Get 'post' allowed html tags for wp_kses
22 $allowed_html = wp_kses_allowed_html('post');
23 // Add additional required tags
24 $allowed_html['select'] = array(
25 'class' => true,
26 'id' => true,
27 'name' => true,
28 'disabled' => true,
29 'required' => true,
30 'multiple' => true,
31 );
32 $allowed_html['option'] = array(
33 'class' => true,
34 'id' => true,
35 'name' => true,
36 'value' => true,
37 'selected' => true,
38 'disabled' => true,
39 );
40 $allowed_html['input'] = array(
41 'class' => true,
42 'id' => true,
43 'name' => true,
44 'type' => true,
45 'value' => true,
46 'checked' => true,
47 'disabled' => true,
48 'readonly' => true,
49 'required' => true,
50 'placeholder' => true,
51 'maxlength' => true,
52 'data-action' => true,
53 );
54 $allowed_html['svg'] = array(
55 'class' => true,
56 'id' => true,
57 'xmlns' => true,
58 'width' => true,
59 'height' => true,
60 'viewbox' => true,
61 'fill' => true,
62 );
63 $allowed_html['path'] = array(
64 'd' => true,
65 'fill' => true,
66 );
67
68 return $allowed_html;
69 }
70
71 public static function _add_display_safe_style_css($styles)
72 {
73 if (!is_array($styles)) {
74 $styles = [];
75 }
76 $styles[] = 'display';
77 return $styles;
78 }
79 }
80