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

导出成员创建的组。

描述

参数

$ user

(必需)

美元的页面

(必需)

email_address美元

保龄球(可选)

默认值:假

返回

(数组)

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

Function process_data($user, $page, $email_address = false) {if (!$user || is_wp_error($user)) {return $this->response(array(), true);} $export_items = array();$data_items = $this->get_data($user, $page);Foreach ($data_items['items'] as $item) {$group_id = "bp_groups";$group_label = __("组",'buddyboss');美元item_id = " {$ this - > exporter_name} - {$ group_id} {$ item - > id}”;《阿凡达》= false美元;美元cover_photo = false;If (function_exists('bp_core_fetch_avatar')) {$avatar = bp_core_fetch_avatar(array('item_id' => $item->id, 'object' => 'group', 'type' => 'full', 'html' => false,)); } if ( function_exists( 'bp_attachments_get_attachment' ) ) { $cover_photo = bp_attachments_get_attachment( 'url', array( 'item_id' => $item->id, 'type' => 'cover-image', 'object_dir' => 'groups', ) ); } if ( empty( $avatar ) || ! $avatar ) { $avatar = __( 'N/A', 'buddyboss' ); } if ( empty( $cover_photo ) || ! $cover_photo ) { $cover_photo = __( 'N/A', 'buddyboss' ); } $group_permalink = bp_get_group_permalink( $item ); $data = array( array( 'name' => __( 'Group Name', 'buddyboss' ), 'value' => $item->name, ), array( 'name' => __( 'Group Description', 'buddyboss' ), 'value' => $item->description, ), array( 'name' => __( 'Group slug', 'buddyboss' ), 'value' => $item->slug, ), array( 'name' => __( 'Created Date (GMT)', 'buddyboss' ), 'value' => $item->date_created, ), array( 'name' => __( 'Group Status', 'buddyboss' ), 'value' => ucfirst( $item->status ), ), array( 'name' => __( 'Group Avatar', 'buddyboss' ), 'value' => $avatar, ), array( 'name' => __( 'Group Cover Photo', 'buddyboss' ), 'value' => $cover_photo, ), array( 'name' => __( 'Group URL', 'buddyboss' ), 'value' => $group_permalink, ), ); $metas2export = array(); $metas2export['total_member_count'] = __( 'Total Members', 'buddyboss' ); $metas2export['last_activity'] = __( 'ast Activity', 'buddyboss' ); /** * Filter allow to add additional metas without issues. */ $metas2export = apply_filters( 'buddyboss_bp_gdpr_group_export_metas', $metas2export, $data_items ); /** * Process the metas. */ foreach ( $item->metas as $meta ) { if ( isset( $metas2export[ $meta->meta_key ] ) ) { $value = $this->easy_readable( $meta->meta_value ); // converting it to user friendly. $value = apply_filters( 'buddyboss_bp_gdpr_group_meta_value_format', $value, $meta ); $data[] = array( 'name' => $metas2export[ $meta->meta_key ], 'value' => $value, ); } } $data = apply_filters( 'buddyboss_bp_gdpr_group_after_data_prepare', $data, $item, $data_items ); $export_items[] = array( 'group_id' => $group_id, 'group_label' => $group_label, 'item_id' => $item_id, 'data' => $data, ); } $done = $data_items['total'] < $data_items['offset']; return $this->response( $export_items, $done ); }

更新日志

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

问题吗?

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