PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 4.0.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v4.0.0
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 month ago class-addons-template-util.php 1 month ago class-allowed-template-html-util.php 1 month ago class-base-exception.php 1 month ago class-cache-constants.php 1 month ago class-cache-exception.php 1 month ago class-key-exception.php 1 month ago class-keytypes.php 1 month ago class-option-exception.php 1 month ago class-quiet-skin.php 1 month ago class-request-exception.php 1 month ago class-script-translations.php 1 month ago class-settings-exception.php 1 month ago class-theme-installer-exception.php 1 month ago class-theme-installer.php 1 month ago
class-allowed-template-html-util.php
82 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 'data-action' => true,
32 );
33 $allowed_html['option'] = array(
34 'class' => true,
35 'id' => true,
36 'name' => true,
37 'value' => true,
38 'selected' => true,
39 'disabled' => true,
40 );
41 $allowed_html['input'] = array(
42 'class' => true,
43 'id' => true,
44 'name' => true,
45 'type' => true,
46 'value' => true,
47 'checked' => true,
48 'disabled' => true,
49 'readonly' => true,
50 'required' => true,
51 'placeholder' => true,
52 'maxlength' => true,
53 'autocomplete' => true,
54 'data-action' => true,
55 );
56 $allowed_html['svg'] = array(
57 'class' => true,
58 'id' => true,
59 'xmlns' => true,
60 'width' => true,
61 'height' => true,
62 'viewbox' => true,
63 'fill' => true,
64 );
65 $allowed_html['path'] = array(
66 'd' => true,
67 'fill' => true,
68 );
69
70 return $allowed_html;
71 }
72
73 public static function _add_display_safe_style_css($styles)
74 {
75 if (!is_array($styles)) {
76 $styles = [];
77 }
78 $styles[] = 'display';
79 return $styles;
80 }
81 }
82