Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_filter( 'preprocess_comment', 'nyt_preprocess_comment' );
function nyt_preprocess_comment($comment) {
if ( strlen( $comment['comment_content'] ) > 5000 ) {
wp_die('Comment is too long.');
}
return $comment;
}
@wpexplorer

This comment has been minimized.

Copy link

commented Apr 27, 2015

Good idea! But 5000 is a long a*s comment ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.