Skip to content

Instantly share code, notes, and snippets.

@mustafauysal
Forked from hberberoglu/gist:d136b4c152011079ea8d
Last active September 21, 2020 16:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafauysal/28e5adca4b5c25aa84cb to your computer and use it in GitHub Desktop.
Save mustafauysal/28e5adca4b5c25aa84cb to your computer and use it in GitHub Desktop.
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
Copy link

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