Question

Question
When writing code that accepts input from users I always sanitize data one variable at a time. Example: $title = wp_strip_all_tags($_POST['title']); $content = wp_strip_all_tags($_POST['content']); I had the idea of simplifying things by sanitizing everything at once, inside a loop: foreach ($_POST as$key => $value) ... 0 10 months 0 Answers 114 views Accepting certain HTML tags in WP List Table column data Question In my Custom Post Type (CPT), 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 List Table ... 0 11 months 0 Answers 71 views How to allow data:image attribute in src tag during post insert? Question I'm inserting a post using wp_post_insert(). And my post's content looks like this: <img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAN4AAAB6CA { ... } but on the insert process, Wordpress removes the data attribute. So below code becomes this: <img src="image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAN4AAAB6CA { ... } I've tried something ... 0 1 year 0 Answers 74 views Why wp_kses() ingoring rel, target of link in WordPress comments Question I am using below code for wp_kses(). But it's ignoring rel & target in the result. I want to show rel="nofolow" target="_blank" in my result (link).$allowed_tags= array( ...
0
1 year 0 Answers 67 views

Why wp_kses() not working for rel, target of link in WordPress

Question
I am using below code for wp_kses(). But it's ignoring rel & target in the result. I want to show rel="nofolow" target="_blank" in my result (link). \$allowed_tags= array( ...
0
1 year 0 Answers 84 views

wp_kses() strips data attributes even if it’s in the allowed list

Question
I added a function that will return the allowed html tags array if ( ! function_exists( 'allowed_html_tags' ) ) { /** * Allowed html tags for wp_kses() function * * @return array Array of ...
0
3 years 0 Answers 100 views