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

	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

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.