Changeset 14186
- Timestamp:
- 12/30/2025 03:38:29 PM (2 weeks ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-activity.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r14077 r14186 18 18 * 19 19 * @since 1.1.0 20 *21 * @return false|null False on failure.22 20 */ 23 21 function groups_register_activity_actions() { 22 23 if ( ! bp_is_active( 'activity' ) ) { 24 return; 25 } 26 24 27 $bp = buddypress(); 25 26 if ( ! bp_is_active( 'activity' ) ) {27 return false;28 }29 28 30 29 bp_activity_set_action( … … 104 103 */ 105 104 function bp_groups_format_activity_action_created_group( $action, $activity ) { 106 $user_link = bp_core_get_userlink( $activity->user_id ); 107 105 $user_link = bp_core_get_userlink( $activity->user_id ); 108 106 $group = bp_groups_get_activity_group( $activity->item_id ); 109 107 $group_link = '<a href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( $group->name ) . '</a>'; … … 133 131 */ 134 132 function bp_groups_format_activity_action_joined_group( $action, $activity ) { 135 $user_link = bp_core_get_userlink( $activity->user_id ); 136 133 $user_link = bp_core_get_userlink( $activity->user_id ); 137 134 $group = bp_groups_get_activity_group( $activity->item_id ); 138 135 $group_link = '<a href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( $group->name ) . '</a>'; … … 173 170 */ 174 171 function bp_groups_format_activity_action_group_details_updated( $action, $activity ) { 175 $user_link = bp_core_get_userlink( $activity->user_id ); 176 172 $user_link = bp_core_get_userlink( $activity->user_id ); 177 173 $group = bp_groups_get_activity_group( $activity->item_id ); 178 174 $group_link = '<a href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( $group->name ) . '</a>'; … … 346 342 } 347 343 348 $retval =array(344 return array( 349 345 'relation' => 'AND', 350 346 array( … … 368 364 ), 369 365 ); 370 371 return $retval;372 366 } 373 367 add_filter( 'bp_activity_set_groups_scope_args', 'bp_groups_filter_activity_scope', 10, 2 ); … … 407 401 ); 408 402 409 $retval =array(403 return array( 410 404 'relation' => 'OR', 411 405 … … 481 475 ), 482 476 ); 483 484 return $retval;485 477 } 486 478 add_filter( 'bp_activity_set_favorites_scope_args', 'bp_groups_filter_activity_favorites_scope', 20, 2 ); … … 646 638 * @since 6.0.0 647 639 * 648 * @param bool $retval True if item can receive comments.649 * @param object $activity Activity item being checked.640 * @param bool $retval True if item can receive comments. 641 * @param object $activity Activity item being checked. 650 642 * @return bool 651 643 */ … … 684 676 * @since 3.0.0 685 677 * 686 * @param bool $retval True if item can receive comments.687 * @param null|BP_Activity_Activity $activity Null by default. Pass an activity object to check against that instead.678 * @param bool $retval True if item can receive comments. 679 * @param null|BP_Activity_Activity $activity Null by default. Pass an activity object to check against that instead. 688 680 * @return bool 689 681 */ … … 719 711 return $retval; 720 712 } 721 add_filter( 'bp_activity_can_comment', 'bp_groups_filter_activity_can_comment', 99 , 1);713 add_filter( 'bp_activity_can_comment', 'bp_groups_filter_activity_can_comment', 99 ); 722 714 723 715 /** … … 728 720 * @since 3.0.0 729 721 * 730 * @param bool $retval True if activity comment can be replied to.731 * @param object|bool $comment Current activity comment object. If empty, parameter is boolean false.722 * @param bool $retval True if activity comment can be replied to. 723 * @param object|bool $comment Current activity comment object. If empty, parameter is boolean false. 732 724 * @return bool 733 725 */ … … 753 745 * @param int $user_id ID of the user joining the group. 754 746 * @param int $group_id ID of the group. 755 * @return false|null False on failure.756 747 */ 757 748 function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) { … … 759 750 // Bail if Activity is not active. 760 751 if ( ! bp_is_active( 'activity' ) ) { 761 return false;762 } 763 764 // Get the group so we can get it 's name.752 return; 753 } 754 755 // Get the group so we can get its name. 765 756 $group = groups_get_group( $group_id ); 766 757 … … 791 782 * @since 2.2.0 792 783 * 793 * @param int $group_id ID of the group. 794 * @param BP_Groups_Group $old_group Group object before the details had been changed. 795 * @param bool $notify_members True if the admin has opted to notify group members, otherwise false. 796 * @return null|WP_Error|bool|int The ID of the activity on success. False on error. 784 * @param int $group_id ID of the group. 785 * @param BP_Groups_Group $old_group Group object before the details had been changed. 786 * @param bool $notify_members True if the admin has opted to notify group members, otherwise false. 797 787 */ 798 788 function bp_groups_group_details_updated_add_activity( $group_id, $old_group, $notify_members ) { … … 800 790 // Bail if Activity is not active. 801 791 if ( ! bp_is_active( 'activity' ) ) { 802 return false;792 return; 803 793 } 804 794 805 795 if ( ! isset( $old_group->name ) || ! isset( $old_group->slug ) || ! isset( $old_group->description ) ) { 806 return false;796 return; 807 797 } 808 798 … … 812 802 } 813 803 814 $group = groups_get_group( array( 815 'group_id' => $group_id, 816 ) ); 804 $group = groups_get_group( $group_id ); 817 805 818 806 /* … … 851 839 852 840 $time = bp_core_current_time(); 841 853 842 groups_update_groupmeta( $group_id, 'updated_details_' . $time, $changed ); 854 843 855 844 // Record in activity streams. 856 returngroups_record_activity( array(845 groups_record_activity( array( 857 846 'type' => 'group_details_updated', 858 847 'item_id' => $group_id, … … 861 850 862 851 ) ); 863 864 852 } 865 853 add_action( 'groups_details_updated', 'bp_groups_group_details_updated_add_activity', 10, 3 ); … … 880 868 } 881 869 } 882 add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_activity' , 10);870 add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_activity' ); 883 871 884 872 /**
Note: See TracChangeset
for help on using the changeset viewer.