Code Duplication    Length = 22-22 lines in 2 locations

includes/acf/fields/checkbox.php 1 location

@@ 298-319 (lines=22) @@
295
	*  @return	$value - the modified value
296
	*/
297
	
298
	function update_value( $value, $post_id, $field ) {
299
		
300
		// validate
301
		if( empty($value) ) {
302
		
303
			return $value;
304
			
305
		}
306
		
307
		
308
		// array
309
		if( is_array($value) ) {
310
			
311
			// save value as strings, so we can clearly search for them in SQL LIKE statements
312
			$value = array_map('strval', $value);
313
			
314
		}
315
		
316
		
317
		// return
318
		return $value;
319
	}
320
	
321
}
322

includes/acf/fields/select.php 1 location

@@ 497-518 (lines=22) @@
494
	*  @return	$value - the modified value
495
	*/
496
	
497
	function update_value( $value, $post_id, $field ) {
498
		
499
		// validate
500
		if( empty($value) ) {
501
		
502
			return $value;
503
			
504
		}
505
		
506
		
507
		// array
508
		if( is_array($value) ) {
509
			
510
			// save value as strings, so we can clearly search for them in SQL LIKE statements
511
			$value = array_map('strval', $value);
512
			
513
		}
514
		
515
		
516
		// return
517
		return $value;
518
	}
519
	
520
	
521
	/*