PluginProbe
Getwid – Gutenberg Blocks / 2.1.3
Getwid – Gutenberg Blocks v2.1.3
3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / includes / allowed-css-tags.php

allowed-css-tags.php in Getwid – Gutenberg Blocks 2.1.3, at includes/allowed-css-tags.php

61 lines 1015 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Getwid;
4
5 /**
6 * Class AllowedCssTags
7 * @package Getwid
8 */
9 class AllowedCssTags {
10
11 /**
12 * AllowedCssTags constructor.
13 */
14 public function __construct() {
15
16 add_filter( 'safe_style_css', [ $this, 'allowed_css' ], 20);
17 $this->allowed_tags();
18 }
19
20 public function allowed_tags() {
21 global $allowedposttags;
22
23 $allowedposttags['canvas'] = array(
24 'class' => array(),
25 'id' => array(),
26 'style' => array(),
27 'width' => array(),
28 'height' => array(),
29 );
30 }
31
32 public function allowed_css($allowed_attr) {
33
34 $new_allowed_attr = array(
35 'background-position',
36 'background-attachment',
37 'background-size',
38 'background-repeat',
39
40 'opacity',
41 'flex-direction',
42 'flex-wrap',
43 'justify-content',
44 'align-content',
45 'align-items',
46 'order',
47 'flex',
48 'align-self',
49 );
50
51 foreach ($new_allowed_attr as $key => $value) {
52 if (!in_array($value, $allowed_attr)){
53 $allowed_attr[] = $value;
54 }
55 }
56
57 return $allowed_attr;
58 }
59
60 }
61