Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
Created March 12, 2014 15:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielbachhuber/9508957 to your computer and use it in GitHub Desktop.
Save danielbachhuber/9508957 to your computer and use it in GitHub Desktop.
Helpful P2 comment settings
<?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' );
@jeremyfelt
Copy link

I added:

add_filter( 'pre_option_default_pingback_flag', '__return_zero' );
add_filter( 'pre_option_default_ping_status', '__return_zero' );

The pre_option_ filters are skipped if the return value === false, so zero seems safer.

@danielbachhuber
Copy link
Author

Dammit. Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment