Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-kses]

Function to filter (validate/sanitize) strings with a view to discharge all not allowed HTML elements.

9
votes
1answer
504 views

How to get SimplePie fetch_feed without stripping iframe code?

I'm grabbing a remote feed in my plugin and some entries have iframe code I want to keep. However, SimplePie fetch_feed keeps stripping it out. Here is my code and what I've tried already: ...
1
vote
1answer
39 views

Why is WordPress Breaking Custom Elements with Hyphens Into Element and Attribute?

Background I have a custom element in a page, which has a tagname of: column-set. On the front end, that gets written as <column -set="">. Question Why is this happening, and can it be ...
0
votes
1answer
304 views

Any ideas how to allow CSS input to perfectly work in the text area with wp_kses?

I'm having issues with wp_kses. I have a text area that allows CSS input (only) While the rest of the CSS gets through (don't have any issues ever since). Until one user , inputs a CSS Code like this ...
2
votes
0answers
191 views

How to allow internal links using wp_kses filtration

I'm working on front end submission and of course I want to secure data by filtering before inserting to database. The form contains repeatable fields group data which I want filter by wp_kses ...
1
vote
0answers
10 views

Accepting certain HTML tags in WP List Table column data

In my custom post type, I altered the display of the post title using the method mentioned here. But for my custom use case, I need to pass some HTML like <sup></sup>. But by default WP ...
1
vote
0answers
25 views

I want to allow the use of a data-flw attribute in links in comments

I have come up with two ways I thought this should work and I'm having no joy with either. First I tried hooking into the preprocess_comment filter. // Set allowed html in comments. add_filter( '...
1
vote
0answers
254 views

Add Attribute to p Tag of Post Content

I would like the default <p> elements that are added to the (TinyMCE) editor when users post content, to have a dir attribute as well. Reasoning: When the editor is displayed to users, it is ...
1
vote
0answers
169 views

Only allow site url in text field using wp_kses/wp_filter_nohtml_kses?

I'm working on validation for a theme options page. Is there a built in way to add an argument to wp_kses/wp_filter_nohtml_kses that will allow a specific link to be entered(wrapped in a tags) but ...
0
votes
0answers
24 views

Remove all <span> elements and style attributes from HTML

I'm retrieving some HTML (regulatory press releases) from an external source via an API. This HTML will be inserted as custom posts into the WordPress database. Naturally, I want to sanitize the ...