Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disale Comments on Custom Activity Types
<?php
/**
* Disale Comments on Custom Activity Types.
*/
function yzc_disable_activity_types_comments( $visibility ) {
$forbidden_types = array( 'activity_status', 'bbp_topic_create', 'bbp_reply_create', 'friendship_accepted','friendship_created', 'new_blog_post' );
if ( in_array( bp_get_activity_type(), $forbidden_types ) ) {
return false;
}
return $visibility;
}
add_filter( 'bp_activity_can_comment', 'yzc_disable_activity_types_comments', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment