kses_init
is hooked onto the init
hook with default priority, and (after first removing any of the kses filters) adds filters which strip out tags (wp_filter_post_kses
for posts and wp_filter_kses
for comments) if the user does not have the capability ‘unfiltered_html’.
Since the capability determines whether or not the user can post ‘unfiltered_html’ comments and posts – you probably don’t want to just remove that capability.
Instead, hook onto init
, after kses_init
, say with priority 20, and re-add the filters which strip out tags not in the $allowedtags
whitelist:
add_action('init','wpse56687_filter_everyones_comments',20);
function wpse56687_filter_everyones_comments(){
add_filter( 'pre_comment_content', 'wp_filter_kses' );
}
Related Posts:
- Change allowed HTML tags for comments
- Allowing more elements in comments via functions.php
- Is it possible to pull comments from facebook into your blog?
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- How to use a custom comments template
- Comment visibility
- Get comments for more than one post
- Add placeholder attribute to comment form fields
- Set post comments open function
- “Categories” for comments?
- Allow anonymous comments, but prevent spam [closed]
- Where to remove from comment’s feed?
- Allow guests comments on single post
- Delete all user comments
- Why do I get email notifications about comments that WordPress has already determined are spam?
- Delayed commenting
- “Leave a comment” link even when you can’t
- An action hook where a comment meta is updated
- Display number of comment replies
- User can post only one comment per day on one page
- Last comment page first with full number of comments?
- Only subscriber role user can comment not other
- customize comment form
- How to check if commenter is the_author?
- Relaxing unescaped HTML filtering inside tags?
- WordPress comments email notification for authors
- How to get the result of comments_number() as a string instead of printing it out?
- Should I still worry about paginated comments with the latest wordpress versions?
- How to dont allow registered users to comment without being logged in?
- edit comments capability for authors
- Publish a message on facebook after having posted a comment
- Users with custom roles can’t read each other’s comments
- Why is_wp_error() is not returning false even there’s no defined error
- wp_insert_comment and security
- How can someone submit a comment when my site has no comment field?
- Separete trackbacks/pings and numbered comments
- How can I fix wp_insert_comment failure when ‘comment_content” includes slanted apostrophe in Excel csv source data
- Show comments in a popup
- highlight “starred” comments by admin
- How to display html in only the first level of WP comments?
- Set noindex page-comment from Pages 2, 3 and More?
- How can I convert anonymous commenters into registered users?
- your comment awaiting moderation message sometimes not appearing
- Limit comments per user per post
- Filter In Reply comments from WordPress Admin Panel
- How can I assign a specific id to the last comment of a post
- Modify WordPress Comment From For AMP Html
- Get Post ID within wp_set_comment_status hook
- How to implement comments on specific fields in wordpress?
- delete duplicate comments
- Cancel comment filter?
- get_comments not working consistantly with post_id
- Comments are invisible, what’s the problem with wp_list_comments?
- WP confusing “links to my articles” with “comments”?
- How to check if a comment has replies?
- Can I have Comments open to specific users only?
- How to edit the text below “Leave a Reply”
- Safe to remove this: when using a 3rd Party Comment App? [closed]
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Review count per product
- Moving post’s content to post’s comments section
- How to create post comment from different domain
- Comments on future posts
- Display custom text when comments are closed
- Returning error upon comment being flagged as spam
- I need to disable Disqus comments pre-approval, but i can’t find where
- JetPack comment threads are displaying above comment box? [closed]
- How to Trigger comment_form_after action if comment_form() not used
- Need Comment Link Help
- Page comes up blank using w3 total cache [closed]
- Comment Table Size Results in Slow Page Loads and 500 Errors
- Insert ads between comments
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- How to show username in reply to comment?
- Custom sort comments with select form
- Subcriber getting multiiple notifications for new comments
- Limit Comment Line Count – Add Read More Button
- Commenter username copies author username
- Fire Social Annex Code on Comment Approval
- Displaying comment rating stars in carousel
- Enable comments option
- Change Comment Text [duplicate]
- Comments closed but enabled on edit screen
- Let user delete comment on front end only
- How to force users to nest their comments
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Insert comment and still use moderation
- Auto approve all comments (editor)
- add field comment [duplicate]
- Let users comment on categories in WordPress
- Loop not displaying comments_popup_link
- Display of comment_date within get_comments?
- How to batch convert comments to posts?
- Customize comment notification e-mails with HTML
- prevent duplicate comments using wp_insert_comment
- I need help about wordpress of members section
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Customize the new comment notifications sent to the post author after the comment is approved
- Get approved comments or comments that the author is me