Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/25/2019 01:54:40 PM (4 months ago)
Author:
imath
Message:

BP Settings: Introduce a new BP friendly name key into data exporters

The name of this key is exporter_bp_friendly_name. It is added to BP & WP exporter arrays to adapt the existing exporter_friendly_name for a non Administrator role context. If this new key is provided it will be used to output the friendly name of the exported items, otherwise it will use the existing exporter_friendly_name key.

For example, into the items list of the site.url/username/settings/data page of the logged in user, "WordPress Comments" will be replaced by "Comments" and so on for every built-in WordPress and BuddyPress items.

Props sbrajesh, r-a-y, boonebgorges

Fixes #8013

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-filters.php

    r12163 r12416  
    371371 *
    372372 * @since 4.0.0
     373 * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters.
    373374 *
    374375 * @param array $exporters  An array of personal data exporters.
     
    377378function bp_groups_register_personal_data_exporters( $exporters ) {
    378379    $exporters['buddypress-groups-memberships'] = array(
    379         'exporter_friendly_name' => __( 'BuddyPress Group Memberships', 'buddypress' ),
    380         'callback'               => 'bp_groups_memberships_personal_data_exporter',
     380        'exporter_friendly_name'    => __( 'BuddyPress Group Memberships', 'buddypress' ),
     381        'callback'                  => 'bp_groups_memberships_personal_data_exporter',
     382        'exporter_bp_friendly_name' => _x( 'Group Memberships', 'BuddyPress Group Memberships data exporter friendly name', 'buddypress' ),
    381383    );
    382384
    383385    $exporters['buddypress-groups-pending-requests'] = array(
    384         'exporter_friendly_name' => __( 'BuddyPress Pending Group Membership Requests', 'buddypress' ),
    385         'callback'               => 'bp_groups_pending_requests_personal_data_exporter',
     386        'exporter_friendly_name'    => __( 'BuddyPress Pending Group Membership Requests', 'buddypress' ),
     387        'callback'                  => 'bp_groups_pending_requests_personal_data_exporter',
     388        'exporter_bp_friendly_name' => _x( 'Pending Group Membership Requests', 'BuddyPress Pending Group Membership Requests data exporter friendly name', 'buddypress' ),
    386389    );
    387390
    388391    $exporters['buddypress-groups-pending-received-invitations'] = array(
    389         'exporter_friendly_name' => __( 'BuddyPress Pending Group Invitations (Received)', 'buddypress' ),
    390         'callback'               => 'bp_groups_pending_received_invitations_personal_data_exporter',
     392        'exporter_friendly_name'    => __( 'BuddyPress Pending Group Invitations (Received)', 'buddypress' ),
     393        'callback'                  => 'bp_groups_pending_received_invitations_personal_data_exporter',
     394        'exporter_bp_friendly_name' => _x( 'Pending Group Invitations (Received)', 'BuddyPress Pending Group Invitations data exporter friendly name', 'buddypress' ),
    391395    );
    392396
    393397    $exporters['buddypress-groups-pending-sent-invitations'] = array(
    394         'exporter_friendly_name' => __( 'BuddyPress Pending Group Invitations (Sent)', 'buddypress' ),
    395         'callback'               => 'bp_groups_pending_sent_invitations_personal_data_exporter',
     398        'exporter_friendly_name'    => __( 'BuddyPress Pending Group Invitations (Sent)', 'buddypress' ),
     399        'callback'                  => 'bp_groups_pending_sent_invitations_personal_data_exporter',
     400        'exporter_bp_friendly_name' => _x( 'Pending Group Invitations (Sent)', 'BuddyPress Pending Group Invitations data exporter friendly name', 'buddypress' ),
    396401    );
    397402
Note: See TracChangeset for help on using the changeset viewer.