Skip to main content

Questions tagged [allowedtags]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
1k views

How to allow data:image attribute in src tag during post insert?

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, ...
Mustafa Demir's user avatar
0 votes
1 answer
1k views

Change allowed HTML tags for comments

I've set up a HTML editor for WordPress comments, and I want to change the allowed HTML tags for comments accordingly. Some of the HTML tags also have inline styling, or classes added. I only want to ...
Swen's user avatar
  • 1,374
0 votes
2 answers
711 views

Could you please correct the code is_admin()

I have this code in my function.php: add_action( 'init', 'blockusers_init' ); function blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined(...
user109025's user avatar
3 votes
0 answers
406 views

Adding target and _blank as it's value to the allowedtags

I know that WordPress uses KSES to parse HTML and strip invalid XHTML so I took control of $allowedtags in my themes functions.php file inside a function then added 'target' keyed to an array which ...
Eujinks's user avatar
  • 139
2 votes
3 answers
801 views

Filtering the Comment Form Allowed Tags

How can I remove some of the allowed HTML tags in comments/posts? For whatever reason, the following code, placed in my theme's functions.php, didn't work: add_action('init', 'my_html_tags_code', 10);...
Yoav Kadosh's user avatar
0 votes
1 answer
859 views

Allow tags and attributes in post and pages content

I am trying to allow the "onclick" attribute on links as well as some html tags such as iframe to the content displayed in posts and pages. In my theme's functions.php file, I tried removing ...
Iam Zesh's user avatar
  • 103
0 votes
1 answer
1k views

Disable html in custom post types

My webstie have custom post type created, and now I want to disable usage of any html tag in content editor, so only plain text is saved in database (and to remove content editor and html editor if ...
SomeoneS's user avatar
  • 125
1 vote
1 answer
354 views

preg_replace and comment_form_defaults

this was kinda of a joke at the beginning but now I'm wondering if it's possible to use regex with the hook comment_form_defaults. Here is what I'm looking for : function remove_default_allowed_tags( ...
JMau's user avatar
  • 2,923
3 votes
1 answer
2k views

Allow all attributes in $allowedposttags tags

I would like to use $allowedposttags to allow extra HTML tags during entry submission. Can I allow all attributes for a specific tag using $allowedposttags? For example, the code below will allow ...
getWeberForStackExchange's user avatar
1 vote
1 answer
128 views

Make WordPress process admin group comments using $allowedtags

WP uses $allowedtags to limit the set of allowable tags for comments.However, comments from administrators are unfiltered. What's the easiest way to ensure admin comments are also constrained to the ...
anu's user avatar
  • 9,552