Created
March 4, 2022 01:38
-
-
Save KaineLabs/2380197e6ee66d3afe794d3adbc1ddd9 to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Sync Custom Post Type Activity Comments with Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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