Created
March 12, 2014 15:13
-
-
Save danielbachhuber/9508957 to your computer and use it in GitHub Desktop.
Helpful P2 comment settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Permit anyone to post HTML in the comments | |
* Because ThunderP2 is only accessible by qualified users, | |
* this is just fine. | |
*/ | |
add_action( 'init', function() { | |
remove_filter( 'pre_comment_content', 'wp_filter_kses' ); | |
add_filter( 'pre_comment_content', 'wp_filter_post_kses' ); | |
}, 11 ); | |
/** | |
* Improve comment settings: | |
* - Turn off moderation | |
* - Don't require new authors to have one approved comment | |
*/ | |
add_filter( 'pre_option_comment_moderation', '__return_false' ); | |
add_filter( 'pre_option_comment_whitelist', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added:
The
pre_option_
filters are skipped if the return value=== false
, so zero seems safer.