Code Duplication    Length = 11-18 lines in 3 locations

includes/acf/api/api-template.php 1 location

@@ 449-459 (lines=11) @@
446
		
447
		
448
		// attempt to find sub field
449
		if( $change ) {
450
			
451
			$sub_field = acf_get_sub_field($selector, $row['field']);
452
			
453
			if( $sub_field ) {
454
				
455
				$sub_exists = isset($row['value'][ $row['i'] ][ $sub_field['key'] ]);
456
				
457
			}
458
			
459
		}
460
		
461
		
462
		// If post_id has changed, this is most likely an archive loop

includes/acf/pro/fields/repeater.php 2 locations

@@ 124-141 (lines=18) @@
121
		
122
		
123
		// If there are less values than min, populate the extra values
124
		if( $field['min'] ) {
125
			
126
			for( $i = 0; $i < $field['min']; $i++ ) {
127
			
128
				// continue if already have a value
129
				if( array_key_exists($i, $field['value']) ) {
130
				
131
					continue;
132
					
133
				}
134
				
135
				
136
				// populate values
137
				$field['value'][ $i ] = $empty_row;
138
				
139
			}
140
			
141
		}
142
		
143
		
144
		// If there are more values than man, remove some values
@@ 145-157 (lines=13) @@
142
		
143
		
144
		// If there are more values than man, remove some values
145
		if( $field['max'] ) {
146
		
147
			for( $i = 0; $i < count($field['value']); $i++ ) {
148
			
149
				if( $i >= $field['max'] ) {
150
				
151
					unset( $field['value'][ $i ] );
152
					
153
				}
154
				
155
			}
156
			
157
		}
158
		
159
		
160
		// setup values for row clone