diff --git src/wp-includes/comment.php src/wp-includes/comment.php
index c134aadcd0..e2c5ccbd3c 100644
|
|
function wp_handle_comment_submission( $comment_data ) { |
3222 | 3222 | } |
3223 | 3223 | } |
3224 | 3224 | |
3225 | | if ( '' == $comment_content ) { |
3226 | | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); |
3227 | | } |
3228 | | |
3229 | 3225 | $commentdata = compact( |
3230 | 3226 | 'comment_post_ID', |
3231 | 3227 | 'comment_author', |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3237 | 3233 | 'user_ID' |
3238 | 3234 | ); |
3239 | 3235 | |
| 3236 | /** |
| 3237 | * Filters whether an empty comment should be allowed. |
| 3238 | * |
| 3239 | * @since 5.0.0 |
| 3240 | * |
| 3241 | * @param bool $allow_empty_comment Default false. |
| 3242 | * @param array $commentdata Array of comment data to be sent to wp_insert_comment(). |
| 3243 | */ |
| 3244 | $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata ); |
| 3245 | if ( '' === $comment_content && ! $allow_empty_comment ) { |
| 3246 | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); |
| 3247 | } |
| 3248 | |
3240 | 3249 | $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); |
3241 | 3250 | if ( is_wp_error( $check_max_lengths ) ) { |
3242 | 3251 | return $check_max_lengths; |