New answers tagged

-1

This is how to submit a comment without any text in the textarea... function rei_preprocess_comment($comment_data) { if ($comment_data['comment_content'] == '%dummy-text%') { $comment_data['comment_content'] = ''; // replace dummy text. } return $comment_data; } add_filter('preprocess_comment', 'rei_preprocess_comment'); function ...


3

WordPres will not allow you, using its default comment process, to insert empty comments into the database. This is enforced by wp_handle_comment_submission() with the following unconditional code: if ( '' == $comment_content ) { return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); } ...



Top 50 recent answers are included