Forked from hberberoglu/gist:d136b4c152011079ea8d
Last active
September 21, 2020 16:00
-
-
Save mustafauysal/28e5adca4b5c25aa84cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good idea! But 5000 is a long a*s comment ;)