-
Notifications
You must be signed in to change notification settings - Fork 4
Serialized array's should be correctly displayed in the CSV #15
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Serialized array's are not converted to usable data in the result CSV
This is easily realized by changing user-export-with-their-meta-data/includes/class-wp-users.php
Add after line 102
public static function is_serial($string) {
return (@unserialize($string) !== false);
}On line 99, replace
$user_rows[ $record->user_id ][ $record->meta_key ] = $record->meta_value;with
if ($this->is_serial($record->meta_value)) {
$temp="";
$space="";
foreach (unserialize($record->meta_value) as $tempArray) {
if (is_array($tempArray)) {
$temp.=$record->meta_value.$space;
} else {
$temp.=$tempArray.$space;
}
}
$user_rows[ $record->user_id ][ $record->meta_key ]=$temp;
} else {
$user_rows[ $record->user_id ][ $record->meta_key ]=$record->meta_value;
}Only the first level values of the array's are being converted. All the other levels remain untouched
With kind regards,
Felix Wagemakers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request