Code Duplication    Length = 14-18 lines in 2 locations

includes/acf/fields/post_object.php 1 location

@@ 346-359 (lines=14) @@
343
			
344
			
345
			// set choices
346
			if( !empty($posts) ) {
347
				
348
				foreach( array_keys($posts) as $i ) {
349
					
350
					// vars
351
					$post = acf_extract_var( $posts, $i );
352
					
353
					
354
					// append to choices
355
					$field['choices'][ $post->ID ] = $this->get_post_title( $post, $field );
356
					
357
				}
358
				
359
			}
360
			
361
		}
362

includes/acf/pro/acf-pro.php 1 location

@@ 298-315 (lines=18) @@
295
			$field['sub_fields'] = array();
296
			
297
			
298
			if( !empty($sub_fields) ) {
299
			
300
				foreach( array_keys($sub_fields) as $i ) {
301
					
302
					// extract sub field
303
					$sub_field = acf_extract_var( $sub_fields, $i );
304
							
305
					
306
					// attributes
307
					$sub_field['parent'] = $field['key'];
308
					
309
					
310
					// append to extra
311
					$extra[] = $sub_field;
312
					
313
				}
314
				
315
			}
316
			
317
		} elseif( $field['type'] == 'flexible_content' ) {
318