Code Duplication    Length = 34-34 lines in 2 locations

includes/acf/api/api-helpers.php 2 locations

@@ 2227-2260 (lines=34) @@
2224
2225
));
2226
2227
function acf_convert_date_to_php( $date ) {
2228
	
2229
	// vars
2230
	$ignore = array();
2231
	
2232
	
2233
	// conversion
2234
	$php_to_js = acf_get_setting('php_to_js_date_formats');
2235
	
2236
	
2237
	// loop over conversions
2238
	foreach( $php_to_js as $replace => $search ) {
2239
		
2240
		// ignore this replace?
2241
		if( in_array($search, $ignore) ) {
2242
			
2243
			continue;
2244
			
2245
		}
2246
		
2247
		
2248
		// replace
2249
		$date = str_replace($search, $replace, $date);
2250
		
2251
		
2252
		// append to ignore
2253
		$ignore[] = $replace;
2254
	}
2255
	
2256
	
2257
	// return
2258
	return $date;
2259
	
2260
}
2261
2262
/*
2263
*  acf_convert_date_to_js
@@ 2275-2308 (lines=34) @@
2272
*  @return	$post_id (int)
2273
*/
2274
2275
function acf_convert_date_to_js( $date ) {
2276
	
2277
	// vars
2278
	$ignore = array();
2279
	
2280
	
2281
	// conversion
2282
	$php_to_js = acf_get_setting('php_to_js_date_formats');
2283
	
2284
	
2285
	// loop over conversions
2286
	foreach( $php_to_js as $search => $replace ) {
2287
		
2288
		// ignore this replace?
2289
		if( in_array($search, $ignore) ) {
2290
			
2291
			continue;
2292
			
2293
		}
2294
		
2295
		
2296
		// replace
2297
		$date = str_replace($search, $replace, $date);
2298
		
2299
		
2300
		// append to ignore
2301
		$ignore[] = $replace;
2302
	}
2303
	
2304
	
2305
	// return
2306
	return $date;
2307
	
2308
}
2309
2310
2311
/*