Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • @superp777

    Participant

    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.

    @superp777

    Participant

    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

    @superp777

    Participant
    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!

    @superp777

    Participant

    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

    @superp777

    Participant

    [SOLVED] Heartbeat control plugin was the culprit

    @superp777

    Participant

    If anyone is looking for a solution – sorted this out creating a custom header with the nav menu I want.

    @superp777

    Participant

    Thanks, Venutius.

    @superp777

    Participant

    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.

    @superp777

    Participant

    @superp777

    Participant

    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.

    @superp777

    Participant

    Thanks!

    @superp777

    Participant

    Thanks, Prashant!

Viewing 12 replies - 1 through 12 (of 12 total)
Skip to toolbar