Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/20/2022 08:10:19 AM (3 years ago)
Author:
imath
Message:

Settings: put the Legacy template pack’s in line with Nouveau’s one

Makes sure, just like the BP Nouveau template pack, the BP Legacy’s members/single/settings/data.php template contains a section to inform how the user can completely remove their data. This commit also brings some complementary improvements:

  • Avoid is_super_admin( $user_id ) usage in favor of a capability check.
  • Remove some commented code which was duplicated from a previous section into the legacy settings/data template.
  • Escape URLs and translated strings.
  • Improve `/* Translators: */ inline comment.
  • Do not show the link to delete an account to an administrator viewing their account as they are redirected to the member's home page when trying to reach the delete-account screen (Admins cannot delete their account form front end).

Props Venutius, tahmidulkarim

Closes https://github.com/buddypress/buddypress/pull/23
Fixes #8021

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-settings/classes/class-bp-settings-component.php

    r13140 r13327  
    221221                'screen_function' => 'bp_settings_screen_delete_account',
    222222                'position'        => 90,
    223                 'user_has_access' => ! is_super_admin( bp_displayed_user_id() )
     223                'user_has_access' => ! user_can( bp_displayed_user_id(), 'delete_users' ),
    224224            );
    225225        }
Note: See TracChangeset for help on using the changeset viewer.