Remove array control on metrics data and add an autoconversion of PHP Object in PHP array.

For json request, i use the variable instead of label in metrics.

The variable names are lower case, without accent, without space (more stable than a label in a site).
This commit is contained in:
Kef
2019-04-22 10:41:20 +02:00
parent 81b4f0143b
commit e2aeaf4fc9
2 changed files with 6 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ class SP_Player extends SP_Custom_Post {
$metric = sp_array_value( $metrics, $key, null );
if ( $metric == null )
continue;
$data[ $value ] = sp_array_value( $metrics, $key, ' ' );
$data[ $key ] = sp_array_value( $metrics, $key, ' ' );
endforeach;
return $data;
}