Custom Post Type Tracking
After reading this up and down https://codex.buddypress.org/plugindev/post-types-activities/ and trying to find different ways of doing the same kinds of registering of custom post type post and comment tracking…I could never get it working 100%.
Either the custom post / custom post comment filters disappear when I add
//add_filter( 'bp_blogs_record_post_post_types', 'bbg_record_video_post_type_comments' ); //add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_video_post_type_comments' );
or set everything up with the CPT registering I can’t modify the comment activity action after the fact…
add_filter('bp_blogs_activity_new_comment_action', 'comment_activity_action', 11, 3);
Finally I ended up trying taking the bp_blogs_register_post_tracking_args function from bp-blogs-activity.php and modifying for my custom post type…and it worked all the way up to 99% of the way because some CPT comment activities get recorded as activity_updates and not as blog activities.
add_filter( 'bp_activity_get_post_type_tracking_args', 'bp_blogs_register_video_tracking_args', 10, 2 );
Is it ok to go bp_activity_get_post_type_tracking_args instead of bp_activity_set_post_type_tracking_args? I’m just trying to get my own CPT up with post and comments tracking…and I would like to modify the activity actions of each.
- You must be logged in to reply to this topic.