$query; } /* * try to extract a single entity * for example : ["string"] -> "string" * or : ["", "string"] -> "string" * */ $output = \CUSTER\extract_smallest_entity($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); $date = date_create('@' . $timestamp); $output = $date->format($output_date_format); } } /* * check options to format the result * */ return \CUSTER\return_result($output, $if_empty); } ?>