Changeset 42661
- Timestamp:
- 02/07/2018 08:08:47 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r42343 r42661 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', … … 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 ) ) {
Note: See TracChangeset
for help on using the changeset viewer.