BuddyPress xProfile Serialized Data
-
In order to properly deserialize data from BuddyPress, I made the following changes:
if ( isset( $bp_data ) && isset( $bp_data[$field] ) && in_array( $field, $bp_fields_passed ) ) {
$value = $bp_data[$field];
if ( is_array( $value ) ) {
$value = maybe_unserialize($value[‘field_data’]);
}
$value = $this->sanitize($value);// check if this is a BP field we want the updated date for ##
}Instead of $value = $value[‘field_data’]; I wrap it in a maybe_unserialize.
Then, just before if($is_csv) check around line 557 I added this:
$value = is_array( $value ) ? implode(“, “, $value ) : $value; // maybe serialize the value ##That ensures that serialized data gets imploded into a comma-delimited list for exporting.
- The topic ‘BuddyPress xProfile Serialized Data’ is closed to new replies.