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

@@ -16,12 +16,6 @@ if (!defined('ABSPATH')) {
function add_partenaires_CIPF($customer_data){
PLGNTLS_class::debug_infos();
$role_partner = PLGNTLS_class::ROLE_PARTNER;
error_log("----");
error_log("in add_partenaires");
error_log("_POST");
error_log(json_encode($_POST));
error_log("_SERVER");
error_log(json_encode($_SERVER));
$current_url = $_SERVER['HTTP_REFERER']; // not reliable to use referer, TODO: find another solution
$path_brut = parse_url($current_url, PHP_URL_PATH);

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;