Hi Velli,
Please share the post type(is it post or a custom post type?) and category(term) id.Regards
BrajeshPlease put the following code to your bp-custom.php
/** * Disable recording posting from a specific category to BuddyPress activity * * @param bool $enabled allow posting? * @param int $blog_id blog id. * @param int $post_id post id. * @param int $user_id user id. * * @return bool */ function buddydev_disable_category_post_from_activity_recording( $enabled, $blog_id, $post_id, $user_id ) { $category_id = 165; $taxonomy = 'category'; if ( has_term( $category_id, $taxonomy, $post_id ) ) { // I could use has_category() but has_terms can be a better example for future customization. $enabled = false; } return $enabled; } add_filter( 'bp_activity_post_pre_publish', 'buddydev_disable_category_post_from_activity_recording', 10, 4 );
It will disallow any future recording of posts from that category. It won’t change the activity for already recorded posts though.
Please test and let me know if it works for you or not?
Regards
Brajesh
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘ [Resolved] Hide a specific post category in the activities’ is closed to new replies.
This topic is: resolved