Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youzify - BuddyPress Sync Custom Post Type Activity Comments with Blog
<?php
/**
* Youzify - BuddyPress Sync Custom Post Type Activity Comments with Blog.
* */
function yzc_enable_custom_post_type_blog_comment_sync( $args ) {
$args['new_video'] = (object)array(
'component_id' => 'activity',
'action_id' => 'new_video',
'bp_activity_admin_filter' => __( 'Published a new video', 'youzify' ),
'bp_activity_front_filter' => __( 'Videos', 'youzify' ),
'contexts' => array( 'activity', 'member' ),
'activity_comment' => true,
'position' => 100,
'comments_tracking' => true,
'comment_action_id' => 'new_video_comment',
'post_type' => 'video',
'comment_format_callback' => 'bp_activity_format_activity_action_custom_post_type_comment',
'format_callback' => 'bp_activity_format_activity_action_custom_post_type_post',
);
return $args;
}
add_filter( 'bp_activity_get_post_types_tracking_args', 'yzc_enable_custom_post_type_blog_comment_sync' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment