Event Plus Comments not displayed in Buddypress Activity Feed

For Events Plus, when an event is created, and visitors sign up for an event. Those activities are posted in the buddypress activity feed. What is missing is when a visitor comments on an Event those are not posted to the buddypress activity feed. Is there a way to include them. Comments on regular posts are showing up in the buddypress activity feed.
Thanks

  • PC
    • WPMU DEV Initiate

    Hey there,

    Thanks for posting on the forums.

    Can you kindly allow me to have a closer look at your site so that I can see that in action ?

    You can enable support access via :

    WordPress Dashboard >> WPMU DEV Dashboard >> Support >> Staff Access >> Grant Access.

    If you have not installed WPMU DEV Dashboard plugin yet, kindly do that here : https://premium.wpmudev.org/project/wpmu-dev-dashboard/ and then allow access as per the above process.

    Cheers, PC

  • PC
    • WPMU DEV Initiate

    Hey there,

    I did some research on this one and found that we can modify the buddypress activity loop and have it display comments from the custom post types.

    I could not get the right code to get it working but I have called in our Second level support on the thread here so that they can suggest a code snippet.

    One of them should be around soon.

    Cheers, PC

  • Dharmendra
    • The Incredible Code Injector

    Hello Hawkens,

    I hope you are doing well!

    You can add below mentioned code snippet to your theme's functions.php file. For this you can use a child theme as mentioned here https://premium.wpmudev.org/blog/create-wordpress-child-theme/ to upgrade-safe edit.

    function bbg_record_my_custom_post_type_comments( $post_types ) {
          $post_types[] = 'incsub_event'; // Add your custom post type name to the array.
          return $post_types;
      }
    add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );

    Please have a try and let me know if it works.

    Have a great day!!

  • Dharmendra
    • The Incredible Code Injector

    Hello Hawkens,

    Thanks for your reply and granting for the support access..

    I have tried the same thing and found that this is only working for the newly created events.

    I am getting warning messages i.e. ( Warning: Cannot modify header information - headers already sent by (output started at /home/content/14/4987714/html/gst/wp-content/plugins/bp-custom.php:19) in /home/content/14/4987714/html/gst/wp-includes/pluggable.php on line 883 ) while accessing your site. It seems that there is something wrong with the wp-content/plugins/bp-custom.php file.

    Please check and let me know if it works for newly created events.

    Take care

  • Hawkens
    • New Recruit

    I had tried a solution for custom post through bp-custom I've removed that function too, so the error should be gone.
    When I create a new event yes it appears in the activity feed. When someone comments on the event that is not seen in the activity feed.

  • Dharmendra
    • The Incredible Code Injector

    Hello Hawkens,

    I hope you are doing well!

    Could you please add the below mentioned code in the in the /wp-content/plugins/bp-custom.php file.

    function activity_publish_custom_post_types($cpts) {
    	$cpts[] = 'incsub_event';
    	return $cpts;
    }
    add_filter ( 'bp_blogs_record_post_post_types', 'activity_publish_custom_post_types' );
    add_filter ( 'bp_blogs_record_comment_post_types', 'activity_publish_custom_post_types' );

    Please note that this is only working for the newly created events so please create a new event to test the solution.

    Please have a try and let me know if it works for you.

    Have a great day!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.