Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/2380197e6ee66d3afe794d3adbc1ddd9 to your computer and use it in GitHub Desktop.
Save KaineLabs/2380197e6ee66d3afe794d3adbc1ddd9 to your computer and use it in GitHub Desktop.
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