BP_Xprofile_Export:: process_data ($ user美元的页面保龄球email_address美元

导出成员扩展概要文件字段。

描述

参数

$ user

(必需)

美元的页面

(必需)

email_address美元

保龄球(可选)

默认值:假

返回

(数组)

文件:bp-core / gdpr / class-bp-xprofile-export.php

Function process_data($user, $page, $email_address = false) {if (!$user || is_wp_error($user)) {return $this->response(array(), true);} $export_items = array();/** * Cover Photo & Avatar */ if (function_exists('bp_core_fetch_avatar')) {$ Avatar = bp_core_fetch_avatar(array('item_id' => $user->ID, 'object' => 'user', 'type' => 'full', 'html' => false,));} if (function_exists('bp_attachments_get_attachment')) {$cover_photo = bp_attachments_get_attachment('url', array('item_id' => $user->ID, 'type' => 'cover-image', 'object_dir' => 'members',));} if (empty($avatar) || !$avatar) {$avatar = __('N/A', 'buddyboss');} if (empty($cover_photo) || !cover_photo美元){$ cover_photo = __(“N / A”,“buddyboss”);} $ data[] =数组(的名字 ' => __( ' 《阿凡达》”、“buddyboss”),“价值”= > $《阿凡达》); $data[] = array( 'name' => __( 'Cover Photo', 'buddyboss' ), 'value' => $cover_photo ); $export_items[] = array( 'group_id' => "{$this->exporter_name}-cover-avatar", 'group_label' => __( 'User Profile - Avatar & Cover Photos', 'buddyboss' ), 'item_id' => "{$this->exporter_name}-assets-{$user->ID}", 'data' => $data, ); /** * Xprofile Fields */ $data_items = $this->get_data( $user, $page ); foreach ( $data_items['items'] as $xgroup => $items ) { $group_id = $xgroup; $group_label = __( "User Profile - {$xgroup}", 'buddyboss' ); $item_id = "{$this->exporter_name}-{$group_id}"; $data = array(); foreach ( $items as $item ) { $val = trim( $item['value'] ); if ( empty( $val ) ) { $val = __( 'N/A', 'buddyboss' ); } $data[] = array( 'name' => $item['name'], 'value' => $val ); } $data = apply_filters( 'buddyboss_bp_gdpr_xprofile_after_data_prepare', $data, $items, $data_items ); $export_items[] = array( 'group_id' => $group_id, 'group_label' => $group_label, 'item_id' => $item_id, 'data' => $data, ); } $done = true; // on this we are processing everything at once. return $this->response( $export_items, $done ); }

更新日志

更新日志
版本 描述
BuddyBoss 1.0.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队