diff --git bp-activity/bp-activity-template.php bp-activity/bp-activity-template.php
index 4a6577c..552401a 100644
|
|
|
function bp_activity_type() {
|
| 868 | 868 | function bp_get_activity_action_name() { return bp_get_activity_type(); } |
| 869 | 869 | |
| 870 | 870 | /** |
| | 871 | * Outputs the activity component |
| | 872 | * |
| | 873 | * @since BuddyPress (1.7) |
| | 874 | * |
| | 875 | * @uses bp_get_activity_component() |
| | 876 | */ |
| | 877 | function bp_activity_component() { |
| | 878 | echo bp_get_activity_component(); |
| | 879 | } |
| | 880 | /** |
| | 881 | * Returns the component of the current activity item |
| | 882 | * |
| | 883 | * @since BuddyPress (1.7) |
| | 884 | * |
| | 885 | * @global object $activities_template {@link BP_Activity_Template} |
| | 886 | * @uses apply_filters() Filter 'bp_get_activity_component' to modify |
| | 887 | * |
| | 888 | * @return string The component of the current activity |
| | 889 | */ |
| | 890 | function bp_get_activity_component() { |
| | 891 | global $activities_template; |
| | 892 | |
| | 893 | $component = false; |
| | 894 | |
| | 895 | if ( isset( $activities_template->activity->component ) ) { |
| | 896 | $component = $activities_template->activity->component; |
| | 897 | } |
| | 898 | |
| | 899 | return apply_filters( 'bp_get_activity_component', $component ); |
| | 900 | } |
| | 901 | |
| | 902 | /** |
| 871 | 903 | * Outputs the activity user id |
| 872 | 904 | * |
| 873 | 905 | * @since BuddyPress (1.1) |
diff --git bp-groups/bp-groups-filters.php bp-groups/bp-groups-filters.php
index 08b9040..9ef0847 100644
|
|
|
function groups_filter_forums_root_page_sql( $sql ) {
|
| 169 | 169 | return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' ); |
| 170 | 170 | } |
| 171 | 171 | add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' ); |
| | 172 | |
| | 173 | /** |
| | 174 | * Keep blocked group members from replying to activity items in that group |
| | 175 | * |
| | 176 | * @since BuddyPress (1.7) |
| | 177 | * |
| | 178 | * @param bool $can_comment |
| | 179 | * @return bool |
| | 180 | */ |
| | 181 | function bp_groups_activity_can_comment( $can_comment ) { |
| | 182 | if ( buddypress()->groups->id == bp_get_activity_component() && |
| | 183 | is_user_logged_in() && |
| | 184 | ! current_user_can( 'bp_moderate' ) && |
| | 185 | groups_is_user_banned( bp_loggedin_user_id(), bp_get_activity_item_id() ) |
| | 186 | ) { |
| | 187 | $can_comment = false; |
| | 188 | } |
| | 189 | |
| | 190 | return $can_comment; |
| | 191 | } |
| | 192 | add_filter( 'bp_activity_can_comment', 'bp_groups_activity_can_comment' ); |