Code Duplication    Length = 19-19 lines in 2 locations

src/includes/hooks.php 2 locations

@@ 381-399 (lines=19) @@
378
			)
379
		);
380
381
	} else {
382
383
		$events->register(
384
			"post_publish\\{$slug}"
385
			, 'WordPoints_Hook_Event_Post_Publish'
386
			, array(
387
				'actions' => array(
388
					'toggle_on'  => "post_publish\\{$slug}",
389
					'toggle_off' => array(
390
						"post_depublish\\{$slug}",
391
						"post_depublish_delete\\{$slug}",
392
					),
393
				),
394
				'args'    => array(
395
					"post\\{$slug}" => 'WordPoints_Hook_Arg',
396
				),
397
			)
398
		);
399
	}
400
401
	if ( post_type_supports( $slug, 'comments' ) ) {
402
@@ 401-419 (lines=19) @@
398
		);
399
	}
400
401
	if ( post_type_supports( $slug, 'comments' ) ) {
402
403
		$events->register(
404
			"comment_leave\\{$slug}"
405
			, 'WordPoints_Hook_Event_Comment_Leave'
406
			, array(
407
				'actions' => array(
408
					'toggle_on'  => array(
409
						"comment_approve\\{$slug}",
410
						"comment_new\\{$slug}",
411
					),
412
					'toggle_off' => "comment_deapprove\\{$slug}",
413
				),
414
				'args' => array(
415
					"comment\\{$slug}" => 'WordPoints_Hook_Arg',
416
				),
417
			)
418
		);
419
	}
420
421
	/**
422
	 * Fires when registering the hook events for a post type.