$query; /* * try to extract a string * */ while (is_array($output) && count($output) === 1) $output = reset($output); /* * if is not acf * check if is a date * and format it * to create a DateTime from a time stamp : https://stackoverflow.com/a/12039058/9497573 * */ if (!$is_acf) { $timestamp = false; if (is_string($output)) { $timestamp = strtotime($output); } if ($timestamp !== false) { $date = new DateTime('@' . $timestamp); $output = $date->format($output_date_format); } } return \CUSTER\return_result($output); } ?>