Code Duplication    Length = 15-16 lines in 2 locations

wp-includes/comment.php 2 locations

@@ 1233-1248 (lines=16) @@
1230
	 */
1231
	do_action( 'trash_comment', $comment->comment_ID );
1232
1233
	if ( wp_set_comment_status( $comment, 'trash' ) ) {
1234
		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
1235
		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
1236
		add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );
1237
		add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );
1238
1239
		/**
1240
		 * Fires immediately after a comment is sent to Trash.
1241
		 *
1242
		 * @since 2.9.0
1243
		 *
1244
		 * @param int $comment_id The comment ID.
1245
		 */
1246
		do_action( 'trashed_comment', $comment->comment_ID );
1247
		return true;
1248
	}
1249
1250
	return false;
1251
}
@@ 1320-1334 (lines=15) @@
1317
	 */
1318
	do_action( 'spam_comment', $comment->comment_ID );
1319
1320
	if ( wp_set_comment_status( $comment, 'spam' ) ) {
1321
		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
1322
		delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
1323
		add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );
1324
		add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );
1325
		/**
1326
		 * Fires immediately after a comment is marked as Spam.
1327
		 *
1328
		 * @since 2.9.0
1329
		 *
1330
		 * @param int $comment_id The comment ID.
1331
		 */
1332
		do_action( 'spammed_comment', $comment->comment_ID );
1333
		return true;
1334
	}
1335
1336
	return false;
1337
}