custer format output works with numbers
This commit is contained in:
@@ -16,12 +16,6 @@ if (!defined('ABSPATH')) {
|
|||||||
function add_partenaires_CIPF($customer_data){
|
function add_partenaires_CIPF($customer_data){
|
||||||
PLGNTLS_class::debug_infos();
|
PLGNTLS_class::debug_infos();
|
||||||
$role_partner = PLGNTLS_class::ROLE_PARTNER;
|
$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
|
$current_url = $_SERVER['HTTP_REFERER']; // not reliable to use referer, TODO: find another solution
|
||||||
$path_brut = parse_url($current_url, PHP_URL_PATH);
|
$path_brut = parse_url($current_url, PHP_URL_PATH);
|
||||||
|
|||||||
@@ -15,10 +15,15 @@ if (!defined('ABSPATH')) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function return_result($output) {
|
function return_result($output) {
|
||||||
if (is_array($output) && count($output) === 0)
|
if (is_array($output) && count($output) === 0) {
|
||||||
$output = '';
|
$output = '';
|
||||||
if (!is_string($output))
|
}
|
||||||
|
if (is_numeric($output)) {
|
||||||
|
$output = (string)$output;
|
||||||
|
}
|
||||||
|
if (!is_string($output)) {
|
||||||
$output = json_encode($output, JSON_UNESCAPED_SLASHES);
|
$output = json_encode($output, JSON_UNESCAPED_SLASHES);
|
||||||
|
}
|
||||||
return esc_html($output);
|
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
|
* check if it's an acf field
|
||||||
* second method : check what get_field_object() returns
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$acf_id = 'user_'.$user_id;
|
$acf_id = 'user_'.$user_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user