Komentarz Exiger une longueur minimale de commentaire dans WordPress

<?php
add_filter( 'preprocess_comment', 'minimal_comment_length' );
function minimal_comment_length( $commentdata ) {
     $minimalCommentLength = 20;
      if ( strlen( trim( $commentdata['comment_content'] ) ) &lt; $minimalCommentLength ){
       wp_die( 'All comments must be at least ' . $minimalCommentLength . ' characters long.' );
     }
     return $commentdata;
}
?>
claude61340