Code Duplication    Length = 3-7 lines in 3 locations

src/wp-includes/post.php 1 location

@@ 3316-3322 (lines=7) @@
3313
				$data['ID'] = $import_id;
3314
			}
3315
		}
3316
		if ( false === $wpdb->insert( $wpdb->posts, $data ) ) {
3317
			if ( $wp_error ) {
3318
				return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error);
3319
			} else {
3320
				return 0;
3321
			}
3322
		}
3323
		$post_ID = (int) $wpdb->insert_id;
3324
3325
		// Use the newly generated $post_ID.

src/wp-includes/taxonomy.php 2 locations

@@ 2097-2099 (lines=3) @@
2094
	 */
2095
	$data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args );
2096
2097
	if ( false === $wpdb->insert( $wpdb->terms, $data ) ) {
2098
		return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database' ), $wpdb->last_error );
2099
	}
2100
2101
	$term_id = (int) $wpdb->insert_id;
2102
@@ 3506-3508 (lines=3) @@
3503
		'term_group' => $shared_term->term_group,
3504
	);
3505
3506
	if ( false === $wpdb->insert( $wpdb->terms, $new_term_data ) ) {
3507
		return new WP_Error( 'db_insert_error', __( 'Could not split shared term.' ), $wpdb->last_error );
3508
	}
3509
3510
	$new_term_id = (int) $wpdb->insert_id;
3511