Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/25/2024 04:47:42 AM (18 months ago)
Author:
imath
Message:

Groups: improve group membership management functions

  • Make the functions handling the 5 available group membership actions (promote, demote, ban, unban, remove) usable outside of the BuddyPress Web version. Doing so, the BP REST API will be able to use them so that current hooks used to perform custom code/clear group cache are still fired within this specific context.
  • In BP Nouveau, the group members management interface (which is using the BP REST API) will soon benefit from this work once the BP REST API has been updated. The hook used to notify a group member has been promoted will then be fired and BP Nouveau behavior will be consistent with the BP Legacy one about group membership management.
  • Deprecate some misleading hooks, which were firing even if the group membership action had failed, in favor of new ones which do fire at the right "place".

Props needle

Fixes #9158

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/notifications.php

    r13314 r13873  
    182182
    183183        // fire the hook
    184         do_action( 'groups_demoted_member', $u, $g );
     184        do_action( 'group_member_demoted', $u, $g );
    185185
    186186        $notifications = BP_Notifications_Notification::get( array(
     
    206206
    207207        // fire the hook
    208         do_action( 'groups_demoted_member', $u, $g );
     208        do_action( 'group_member_demoted', $u, $g );
    209209
    210210        $notifications = BP_Notifications_Notification::get( array(
Note: See TracChangeset for help on using the changeset viewer.