Created
February 25, 2019 19:45
-
-
Save taciara/ec930916b0abbef17539e615816ed310 to your computer and use it in GitHub Desktop.
Uma extensão do ACF para selecionar multiplas datas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Utilizando ACF Multi Dates Field - Uma extensão do ACF para selecionar multiplas datas ?> | |
<?php | |
setlocale (LC_ALL, 'pt_BR'); | |
$dataArray = get_field('data_curso'); | |
$data = end($dataArray); | |
$periodoCurso = array_map(function($value) use($data){ | |
if($data == $value) | |
return strftime('%d de %B de %Y',strtotime($value)); | |
return strftime('%d',strtotime($value)); | |
}, $dataArray); | |
$periodoCurso = implode(', ', $periodoCurso); | |
?> | |
<span class="txt"><?php echo $periodoCurso; ?></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment