Code Duplication    Length = 13-13 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 2099-2111 (lines=13) @@
2096
		foreach ( $siblings as $sibling ) {
2097
2098
			// if this is the post that comes after our repositioned post, set our repositioned post position and increment menu order
2099
			if ( $nextid == $sibling->ID ) {
2100
				$wpdb->update(
2101
					$wpdb->posts,
2102
					array(
2103
						'menu_order' => $menu_order
2104
					),
2105
					array( 'ID' => $post->ID ),
2106
					array( '%d' ),
2107
					array( '%d' )
2108
				);
2109
				$new_pos[ $post->ID ] = $menu_order;
2110
				$menu_order++;
2111
			}
2112
2113
			// if repositioned post has been set, and new items are already in the right order, we can stop
2114
			if ( isset( $new_pos[ $post->ID ] ) && $sibling->menu_order >= $menu_order ) {
@@ 2131-2143 (lines=13) @@
2128
			$new_pos[ $sibling->ID ] = $menu_order;
2129
			$menu_order++;
2130
2131
			if ( ! $nextid && $previd == $sibling->ID ) {
2132
				$wpdb->update(
2133
					$wpdb->posts,
2134
					array(
2135
						'menu_order' => $menu_order
2136
					),
2137
					array( 'ID' => $post->ID ),
2138
					array( '%d' ),
2139
					array( '%d' )
2140
				);
2141
				$new_pos[$post->ID] = $menu_order;
2142
				$menu_order++;
2143
			}
2144
2145
		}
2146