Forum Replies Created
-
If anyone is looking for similar functionality the code below worked just great for me:
function buddydev_disable_activity_blog_comment_recording_conditionally( $enabled, $blog_id, $post_id, $user_id, $comment_id ) { // use $post_id to decide. // set $enabled= false; to stop recording comment. if ( ! in_category( 'category', $post_id ) ) { $enabled = false; } return $enabled; } add_filter( 'bp_activity_post_pre_comment', 'buddydev_disable_activity_blog_comment_recording_conditionally', 20, 5 );
Just change “category” with the name of the category you want to get updates from.
Yes, but it is blocking new post updates only.
If someone leaves a comments it shows up in the activity feed. Any way to tweak it for that?
Thanks a lot!
Plamen
function buddydev_disable_category_post_from_activity_recording( $enabled, $blog_id, $post_id, $user_id, $comment_id ) { $category_id = 1; $taxonomy = 'category'; if ( has_term( $category_id, $taxonomy, $post_id, $comment_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 );
I was able to filter new posts with the code above but not sure how to use it for comments as well
Thanks a lot, @Venutius!
Sorry,
Wasn’t clear enough. We have many different WordPress post categories on our blog.
My goal is go get updates on new posts and comments from one category only.Thanks a lot
[SOLVED] Heartbeat control plugin was the culprit
If anyone is looking for a solution – sorted this out creating a custom header with the nav menu I want.
Thanks, Venutius.
Yes, I’m using this plugin as well and it’s great. The issue, however, is that I’m looking for a way to display a specific menu to the community (BuddyPress) members. One that’s different to the primary website menu.
Update: Found out that the reason is BuddyPress supporting Primary Nav menu only.
Is there a way to add support for different menus as well? Thanks.Thanks!
Thanks, Prashant!