Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Gets XProfile fields from the database when exporting metadata
- *
- * @access public
- * @return array User Meta
- */
- public function get_user_meta( $user_meta, $user_id ) {
- if ( ! class_exists( 'BP_XProfile_ProfileData' ) ) {
- return $user_meta;
- }
- $user_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
- foreach ( $user_data as $field ) {
- if ( is_array( $field ) && isset( $field['field_id'] ) ) {
- $data = maybe_unserialize( $field['field_data'] );
- // Clean up special characters
- if ( is_array( $data ) ) {
- $data = array_map( 'htmlspecialchars_decode', $data );
- } else {
- $data = htmlspecialchars_decode( $data );
- }
- $user_meta[ 'bbp_field_' . $field['field_id'] ] = $data;
- }
- }
- return $user_meta;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement