• Resolved DJABHipHop

    (@pressthemes1)


    function ps_limit_comment_length($comment) {

        $max_length = 280;

        if (strlen($comment[‘comment_content’]) > $max_length) {

            wp_die(‘<strong>Warning:</strong> Please keep your comment under ‘ . $max_length . ‘ characters.’, ‘Comment Length Warning’, array(‘response’ => 500, ‘back_link’ => true));

        }

        return $comment;

    }

    add_filter(‘preprocess_comment’, ‘ps_limit_comment_length’);

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.