Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Stop comments over 13k
- Description: A security precaution to stop comments over 13k.
- Version: 0.0.2
- Author: WPEngine
- Author URI: wpengine.com
- License: GPLv2
- */
- add_filter('pre_comment_content', 'wpengine_die_on_long_comment', 9999);
- function wpengine_die_on_long_comment($text) {
- if (strlen($text) > 13000) wp_die('This comment is longer than the maximum allowed size and has been dropped.');
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement