Allowed post tags & attributes
-
Hi? how can i add valus for attributes?
example:
i have string<img src=\"C:/Users/Богдан/Desktop/emoji-picker-master/lib/img//blank.gif\" class=\"img\" style=\"display:inline-block;width:25px;height:25px;background:url('C:/Users/Богдан/Desktop/emoji-picker-master/lib/img//emoji_spritesheet_0.png') -475px -150px no-repeat;background-size:675px 175px;\" alt=\":kiss:\">
after cleaning by wp_kses_post() i get
<img src="/Users/Богдан/Desktop/emoji-picker-master/lib/img//blank.gif" class="img" style="width:25px;height:25px;background-size:675px 175px" alt=":kiss:"/>
i try fix this by code
function allow_onclick_content($allowedposttags) { $allowedposttags["img"]['display'] = true; $allowedposttags["img"]['background'] = true; return $allowedposttags; } add_filter( 'wp_kses_allowed_html', 'allow_onclick_content' );
but it`s not help. How to allow display and background for style-attribute in img-tag?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Allowed post tags & attributes’ is closed to new replies.