Code Duplication    Length = 5-5 lines in 3 locations

wp-includes/post.php 3 locations

@@ 3598-3602 (lines=5) @@
3595
		 */
3596
		if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) {
3597
			$suffix = 2;
3598
			do {
3599
				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
3600
				$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID ) );
3601
				$suffix++;
3602
			} while ( $post_name_check );
3603
			$slug = $alt_post_name;
3604
		}
3605
	} elseif ( is_post_type_hierarchical( $post_type ) ) {
@@ 3628-3632 (lines=5) @@
3625
		 */
3626
		if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug )  || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {
3627
			$suffix = 2;
3628
			do {
3629
				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
3630
				$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) );
3631
				$suffix++;
3632
			} while ( $post_name_check );
3633
			$slug = $alt_post_name;
3634
		}
3635
	} else {
@@ 3673-3677 (lines=5) @@
3670
		 */
3671
		if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || $conflicts_with_date_archive || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) {
3672
			$suffix = 2;
3673
			do {
3674
				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
3675
				$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) );
3676
				$suffix++;
3677
			} while ( $post_name_check );
3678
			$slug = $alt_post_name;
3679
		}
3680
	}