Changeset 13870 for trunk/src/bp-groups/bp-groups-activity.php
- Timestamp:
- 05/24/2024 05:43:34 AM (22 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-activity.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r13496 r13870 651 651 */ 652 652 function bp_groups_filter_activity_user_can_delete( $retval, $activity ) { 653 // Bail if no current user .654 if ( ! is_user_logged_in() ) {653 // Bail if no current user or group activity deletions are disabled. 654 if ( ! is_user_logged_in() || bp_disable_group_activity_deletions() ) { 655 655 return $retval; 656 656 } 657 657 658 if ( isset( $activity->component ) || 'groups' !== $activity->component ) {658 if ( ! isset( $activity->component ) || 'groups' !== $activity->component ) { 659 659 return $retval; 660 660 } 661 661 662 // Trust the passed value for administrators. 663 if ( bp_current_user_can( 'bp_moderate' ) ) { 662 // The first conditional statement will trust the passed value for administrators. 663 // The second conditional statement does not allow "site admin" activity posts to be deleted by "non site admins". 664 if ( bp_current_user_can( 'bp_moderate' ) || bp_user_can( $activity->user_id, 'bp_moderate' ) ) { 664 665 return $retval; 665 666 } 666 667 667 // Group administrators or moderators can delete content in that group that doesn't belong to them.668 668 $group_id = $activity->item_id; 669 670 // Group administrators or moderators can delete content in which deletions are allowed for that group. 669 671 if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) || groups_is_user_mod( bp_loggedin_user_id(), $group_id ) ) { 670 672 $retval = true;
Note: See TracChangeset
for help on using the changeset viewer.