Forum Replies Created
-
In reply to: Activity Sitewide stream filter posts by category
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.
In reply to: Activity Sitewide stream filter posts by categoryYes, 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
In reply to: Activity Sitewide stream filter posts by categoryfunction 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!
In reply to: Activity Sitewide stream filter posts by categorySorry,
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
In reply to: Activity reply redirect[SOLVED] Heartbeat control plugin was the culprit
In reply to: Conditional menu and BuddyPress coreIf anyone is looking for a solution – sorted this out creating a custom header with the nav menu I want.
In reply to: Conditional menu and BuddyPress coreThanks, Venutius.
In reply to: Conditional menu and BuddyPress coreYes, 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.
In reply to: Conditional menu and BuddyPress coreIn reply to: Conditional menu and BuddyPress coreUpdate: 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.In reply to: Conditional menu and BuddyPress coreThanks!
In reply to: Filter Activity by CategoryThanks, Prashant!