@@ -175,7 +175,12 @@ public function get_context_labels() {
175175 public function action_links ( $ links , $ record ) {
176176
177177 // Check we have access to BuddyPress on this blog and that the user will have access to the links.
178- if ( ! $ this ->is_dependency_satisfied () || ! bp_current_user_can_moderate () ) {
178+ if ( ! $ this ->is_dependency_satisfied () ) {
179+ return array ();
180+ }
181+
182+ // Check if user has moderation capabilities (use function_exists to avoid fatal errors).
183+ if ( function_exists ( 'bp_current_user_can ' ) && ! bp_current_user_can ( 'bp_moderate ' ) ) {
179184 return array ();
180185 }
181186
@@ -591,16 +596,14 @@ public function callback_bp_activity_deleted_activities( $activities_ids ) {
591596 if ( 1 === count ( $ activities_ids ) && isset ( $ this ->deleted_activity ) ) { // Single activity deletion.
592597 $ activity = $ this ->deleted_activity ;
593598 $ this ->log (
594- sprintf (
595- /* translators: %s: an activity title (e.g. "Update") */
596- __ ( '"%s" activity deleted ' , 'stream ' ),
597- wp_strip_all_tags ( $ activity ->action )
598- ),
599+ /* translators: %s: an activity title (e.g. "Update") */
600+ __ ( '"%s" activity deleted ' , 'stream ' ),
599601 array (
600- 'id ' => $ activity ->id ,
601- 'item_id ' => $ activity ->item_id ,
602- 'type ' => $ activity ->type ,
603- 'author ' => $ activity ->user_id ,
602+ 'activity_action ' => wp_strip_all_tags ( $ activity ->action ),
603+ 'id ' => $ activity ->id ,
604+ 'item_id ' => $ activity ->item_id ,
605+ 'type ' => $ activity ->type ,
606+ 'author ' => $ activity ->user_id ,
604607 ),
605608 $ activity ->id ,
606609 $ activity ->component ,
@@ -618,11 +621,8 @@ public function callback_bp_activity_deleted_activities( $activities_ids ) {
618621 return ;
619622 }
620623 $ this ->log (
621- sprintf (
622- /* translators: %s: an activity title (e.g. "Update") */
623- __ ( '"%s" activities were deleted ' , 'stream ' ),
624- count ( $ activities_ids )
625- ),
624+ /* translators: %s: number of activities */
625+ __ ( '%s activities were deleted ' , 'stream ' ),
626626 array (
627627 'count ' => count ( $ activities_ids ),
628628 'args ' => $ this ->delete_activity_args ,
@@ -647,16 +647,14 @@ public function callback_bp_activity_mark_as_spam( $activity, $by ) {
647647 unset( $ by );
648648
649649 $ this ->log (
650- sprintf (
651- /* translators: %s an activity title (e.g. "Update") */
652- __ ( 'Marked activity "%s" as spam ' , 'stream ' ),
653- wp_strip_all_tags ( $ activity ->action )
654- ),
650+ /* translators: %s: an activity title (e.g. "Update") */
651+ __ ( 'Marked activity "%s" as spam ' , 'stream ' ),
655652 array (
656- 'id ' => $ activity ->id ,
657- 'item_id ' => $ activity ->item_id ,
658- 'type ' => $ activity ->type ,
659- 'author ' => $ activity ->user_id ,
653+ 'activity_action ' => wp_strip_all_tags ( $ activity ->action ),
654+ 'id ' => $ activity ->id ,
655+ 'item_id ' => $ activity ->item_id ,
656+ 'type ' => $ activity ->type ,
657+ 'author ' => $ activity ->user_id ,
660658 ),
661659 $ activity ->id ,
662660 $ activity ->component ,
@@ -676,16 +674,14 @@ public function callback_bp_activity_mark_as_ham( $activity, $by ) {
676674 unset( $ by );
677675
678676 $ this ->log (
679- sprintf (
680- /* translators: %s: an activity title (e.g. "Update") */
681- __ ( 'Unmarked activity "%s" as spam ' , 'stream ' ),
682- wp_strip_all_tags ( $ activity ->action )
683- ),
677+ /* translators: %s: an activity title (e.g. "Update") */
678+ __ ( 'Unmarked activity "%s" as spam ' , 'stream ' ),
684679 array (
685- 'id ' => $ activity ->id ,
686- 'item_id ' => $ activity ->item_id ,
687- 'type ' => $ activity ->type ,
688- 'author ' => $ activity ->user_id ,
680+ 'activity_action ' => wp_strip_all_tags ( $ activity ->action ),
681+ 'id ' => $ activity ->id ,
682+ 'item_id ' => $ activity ->item_id ,
683+ 'type ' => $ activity ->type ,
684+ 'author ' => $ activity ->user_id ,
689685 ),
690686 $ activity ->id ,
691687 $ activity ->component ,
@@ -705,13 +701,11 @@ public function callback_bp_activity_admin_edit_after( $activity, $error ) {
705701 unset( $ error );
706702
707703 $ this ->log (
708- sprintf (
709- /* translators: %s: an activity title (e.g. "Update") */
710- __ ( '"%s" activity updated ' , 'stream ' ),
711- wp_strip_all_tags ( $ activity ->action )
712- ),
704+ /* translators: %s: an activity title (e.g. "Update") */
705+ __ ( '"%s" activity updated ' , 'stream ' ),
713706 array (
714- 'id ' => $ activity ->id ,
707+ 'activity_action ' => wp_strip_all_tags ( $ activity ->action ),
708+ 'id ' => $ activity ->id ,
715709 'item_id ' => $ activity ->item_id ,
716710 'type ' => $ activity ->type ,
717711 'author ' => $ activity ->user_id ,
0 commit comments