Created
April 15, 2020 17:54
-
-
Save KaineLabs/8c044dc4e9bcc3ab2daf37ad46a42384 to your computer and use it in GitHub Desktop.
Disale Comments on Custom Activity Types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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