verygoodplugins

Untitled

Oct 3rd, 2020
896
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     /**
  2.      * Gets XProfile fields from the database when exporting metadata
  3.      *
  4.      * @access  public
  5.      * @return  array User Meta
  6.      */
  7.  
  8.     public function get_user_meta( $user_meta, $user_id ) {
  9.  
  10.         if ( ! class_exists( 'BP_XProfile_ProfileData' ) ) {
  11.             return $user_meta;
  12.         }
  13.  
  14.         $user_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
  15.  
  16.         foreach ( $user_data as $field ) {
  17.  
  18.             if ( is_array( $field ) && isset( $field['field_id'] ) ) {
  19.  
  20.                 $data = maybe_unserialize( $field['field_data'] );
  21.  
  22.                 // Clean up special characters
  23.  
  24.                 if ( is_array( $data ) ) {
  25.                     $data = array_map( 'htmlspecialchars_decode', $data );
  26.                 } else {
  27.                     $data = htmlspecialchars_decode( $data );
  28.                 }
  29.  
  30.                 $user_meta[ 'bbp_field_' . $field['field_id'] ] = $data;
  31.  
  32.             }
  33.         }
  34.  
  35.         return $user_meta;
  36.  
  37.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×