Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Event comments in BP activity stream and notifications

$
0
0

Replies: 0

Hi.

I have troubles getting event comments to show up in buddypress activity stream and create notifications for the author.

I tried using buddypress bp_activity_set_post_type_tracking_args function but it doesn’t work. The code is the following:

function custom_event_comment_tracking_args(){
	if ( ! bp_is_active( 'activity' ) ) {
        return;
    }
	add_post_type_support( 'event', 'buddypress-activity' );
	
	bp_activity_set_post_type_tracking_args( 'event', array(
		'action_id'                         => 'new_event',
        'bp_activity_admin_filter'          => __( 'A publié un événement', 'custom-textdomain' ),
        'bp_activity_front_filter'          => __( 'Evénement', 'custom-textdomain' ),
        'bp_activity_new_post'              => __( '%1$s a posté un nouvel <a href="%2$s">événement</a>', 'custom-textdomain' ),
        'bp_activity_new_post_ms'           => __( '%1$s a posté un nouvel <a href="%2$s">événement</a>, sur le site %3$s', 'custom-textdomain' ),
        'contexts'                          => array( 'activity', 'member' ),
        'comment_action_id'                 => 'new_event_comment',
        'bp_activity_comments_admin_filter' => __( 'A commenté une page', 'custom-textdomain' ),
        'bp_activity_comments_front_filter' => __( 'Commentaire d'événement', 'custom-textdomain' ),
        'bp_activity_new_comment'           => __( '%1$s a commenté <a href="%2$s">l'événement</a>', 'custom-textdomain' ),
        'bp_activity_new_comment_ms'        => __( '%1$s a commenté <a href="%2$s">l'événement</a>, sur le site %3$s', 'custom-textdomain' ),
        'position'                          => 100,
	) );
}
add_action( 'bp_init', 'custom_event_comment_tracking_args' );

But it just breaks the site.

I know there are BP functions to add activities and notifications but I can’t use those because i don’t know hooks of commenting an event.

It’s a bit weird to be able by default to see event manager’s events in the activity stream, and bookings, but not the comments. How could I achieve that?

Thanks!


Viewing all articles
Browse latest Browse all 59525

Trending Articles