Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/bf236bbcc0dd7771eb1c624bf21dae14 to your computer and use it in GitHub Desktop.
Save KaineLabs/bf236bbcc0dd7771eb1c624bf21dae14 to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Disable Blog Comments
<?php
/**
* Youzify - BuddyPress Disable Blog Comments.
* */
function yzc_blogs_record_comment_post_types( $value ) {
return array();
}
add_action('init', 'yzc_disable_adding_commets_to_blog_posts');
function yzc_disable_adding_commets_to_blog_posts() {
if ( wp_doing_ajax() ) {
if ( isset( $_POST['action'] ) && $_POST['action'] == 'new_activity_comment' ) {
add_filter('bp_blogs_record_comment_post_types', 'yzc_blogs_record_comment_post_types' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment