Code Duplication    Length = 12-21 lines in 2 locations

includes/acf/fields/google-map.php 2 locations

@@ 227-247 (lines=21) @@
224
	*  @return	$post_id (int)
225
	*/
226
	
227
	function validate_value( $valid, $value, $field, $input ){
228
		
229
		// bail early if not required
230
		if( ! $field['required'] ) {
231
			
232
			return $valid;
233
			
234
		}
235
		
236
		
237
		if( empty($value) || empty($value['lat']) || empty($value['lng']) ) {
238
			
239
			return false;
240
			
241
		}
242
		
243
		
244
		// return
245
		return $valid;
246
		
247
	}
248
	
249
	
250
	/*
@@ 266-277 (lines=12) @@
263
	*  @return	$value - the modified value
264
	*/
265
	
266
	function update_value( $value, $post_id, $field ) {
267
	
268
		if( empty($value) || empty($value['lat']) || empty($value['lng']) ) {
269
			
270
			return false;
271
			
272
		}
273
		
274
		
275
		// return
276
		return $value;
277
	}
278
}
279
280
new acf_field_google_map();