custer format output works with numbers

This commit is contained in:
asus
2024-03-17 14:52:42 +01:00
parent 70d8998a3f
commit eaa45c4ed1
2 changed files with 8 additions and 10 deletions

View File

@@ -15,10 +15,15 @@ if (!defined('ABSPATH')) {
*
*/
function return_result($output) {
if (is_array($output) && count($output) === 0)
if (is_array($output) && count($output) === 0) {
$output = '';
if (!is_string($output))
}
if (is_numeric($output)) {
$output = (string)$output;
}
if (!is_string($output)) {
$output = json_encode($output, JSON_UNESCAPED_SLASHES);
}
return esc_html($output);
}
@@ -45,8 +50,7 @@ function format_user_info($query, &$current_user, $user_id) {
/*
* check if it's an acf field, and a date
* second method : check what get_field_object() returns
* check if it's an acf field
*
*/
$acf_id = 'user_'.$user_id;