Created
June 5, 2023 15:28
-
-
Save KaineLabs/bf236bbcc0dd7771eb1c624bf21dae14 to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Disable Blog Comments
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 | |
/** | |
* 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