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-friends/bp-friends-filters.php

    r12160 r12416  
    5353 *
    5454 * @since 4.0.0
     55 * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters.
    5556 *
    5657 * @param array $exporters  An array of personal data exporters.
     
    5960function bp_friends_register_personal_data_exporters( $exporters ) {
    6061    $exporters['buddypress-friends'] = array(
    61         'exporter_friendly_name' => __( 'BuddyPress Friends', 'buddypress' ),
    62         'callback'               => 'bp_friends_personal_data_exporter',
     62        'exporter_friendly_name'    => __( 'BuddyPress Friends', 'buddypress' ),
     63        'callback'                  => 'bp_friends_personal_data_exporter',
     64        'exporter_bp_friendly_name' => _x( 'Friends', 'BuddyPress Friends data exporter friendly name', 'buddypress' ),
    6365    );
    6466
    6567    $exporters['buddypress-friends-pending-sent-requests'] = array(
    66         'exporter_friendly_name' => __( 'BuddyPress Friend Requests (Sent)', 'buddypress' ),
    67         'callback'               => 'bp_friends_pending_sent_requests_personal_data_exporter',
     68        'exporter_friendly_name'    => __( 'BuddyPress Friend Requests (Sent)', 'buddypress' ),
     69        'callback'                  => 'bp_friends_pending_sent_requests_personal_data_exporter',
     70        'exporter_bp_friendly_name' => _x( 'Friend Requests (Sent)', 'BuddyPress Friend Requests data exporter friendly name', 'buddypress' ),
    6871    );
    6972
    7073    $exporters['buddypress-friends-pending-received-requests'] = array(
    71         'exporter_friendly_name' => __( 'BuddyPress Friend Requests (Received)', 'buddypress' ),
    72         'callback'               => 'bp_friends_pending_received_requests_personal_data_exporter',
     74        'exporter_friendly_name'    => __( 'BuddyPress Friend Requests (Received)', 'buddypress' ),
     75        'callback'                  => 'bp_friends_pending_received_requests_personal_data_exporter',
     76        'exporter_bp_friendly_name' => _x( 'Friend Requests (Received)', 'BuddyPress Friend Requests data exporter friendly name', 'buddypress' ),
    7377    );
    7478
Note: See TracChangeset for help on using the changeset viewer.