BP_Xprofile_Export::get_data( $user, $page )
Returns the data & count of activities by page and user.
Description
Parameters
- $user
-
(Required)
- $page
-
(Required)
Return
(array)
Source
File: bp-core/gdpr/class-bp-xprofile-export.php
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | function get_data( $user , $page ) { global $wpdb , $bp ; $wpdb ->show_errors( false ); $items = array (); $xprofile_groups = bp_xprofile_get_groups(); $field_table = $bp ->profile->global_tables[ "table_name_fields" ]; foreach ( $xprofile_groups as $xgroup ) { $fields = $wpdb ->get_results( $wpdb ->prepare( "SELECT *FROM {$field_table} WHERE group_id=%d AND parent_id=0" , $xgroup ->id ) ); foreach ( $fields as $key => $field ) { $field = ( array ) $field ; $field [ 'value' ] = xprofile_get_field_data( $field [ 'id' ], $user ->ID, 'comma' ); $fields [ $key ] = $field ; } $items [ $xgroup ->name ] = $fields ; } return array ( 'total' => 1, 'offset' => 0, 'items' => $items , ); } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.