Code Duplication    Length = 13-13 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 2076-2088 (lines=13) @@
2073
		foreach ( $siblings as $sibling ) {
2074
2075
			// if this is the post that comes after our repositioned post, set our repositioned post position and increment menu order
2076
			if ( $nextid == $sibling->ID ) {
2077
				$wpdb->update(
2078
					$wpdb->posts,
2079
					array(
2080
						'menu_order' => $menu_order
2081
					),
2082
					array( 'ID' => $post->ID ),
2083
					array( '%d' ),
2084
					array( '%d' )
2085
				);
2086
				$new_pos[ $post->ID ] = $menu_order;
2087
				$menu_order++;
2088
			}
2089
2090
			// if repositioned post has been set, and new items are already in the right order, we can stop
2091
			if ( isset( $new_pos[ $post->ID ] ) && $sibling->menu_order >= $menu_order ) {
@@ 2108-2120 (lines=13) @@
2105
			$new_pos[ $sibling->ID ] = $menu_order;
2106
			$menu_order++;
2107
2108
			if ( ! $nextid && $previd == $sibling->ID ) {
2109
				$wpdb->update(
2110
					$wpdb->posts,
2111
					array(
2112
						'menu_order' => $menu_order
2113
					),
2114
					array( 'ID' => $post->ID ),
2115
					array( '%d' ),
2116
					array( '%d' )
2117
				);
2118
				$new_pos[$post->ID] = $menu_order;
2119
				$menu_order++;
2120
			}
2121
2122
		}
2123