First, @henrywright, I think you were right, that code was not creating the entry, it was created because I had add_post_type_support( 'alert', 'buddypress-activity' );
in bp-custom too. Thanks for making me think twice.
It’s amazing what you can learn in 12 hours. Not enough, but it’s a start. So I tossed the baby out with the bathwater, and read this about 15 times to get to a partial understanding of it. I am now using this:
// Don't forget to add the 'buddypress-activity' support!
add_post_type_support( 'alert', 'buddypress-activity' );
function customize_page_tracking_args() {
// Check if the Activity component is active before using it.
if ( ! bp_is_active( 'activity' ) ) {
return;
}
bp_activity_set_post_type_tracking_args( 'alert', array(
/*'component_id' => buddypress()->blogs->id,*/
'action_id' => 'new_alert',
'bp_activity_admin_filter' => __( 'Published a new alert', 'buddypress' ),
'bp_activity_front_filter' => __( 'Alerts', 'buddypress' ),
'contexts' => array( 'activity', 'member' ),
'activity_comment' => true,
'bp_activity_new_post' => __( '%1$s posted an important new <a href="%2$s">** Alert **</a>', 'buddypress' ),
'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">alert</a>, on the site %3$s', 'buddypress' ),
'position' => 100,
) );
}
add_action( 'bp_init', 'customize_page_tracking_args' );
After about 20 different mods, adding and deleting and changing, I got a CPT to take to the activity stream, with the (mostly) modified text I was looking for.
I actually don’t even know what some of the items in the array are, I just changed things until they worked. 🙂 In fact, I had to comment out component id, because I still haven’t figured out what goes there to keep from getting a WSOD.
The only main thing I’d really still like to accomplish is getting the Post Title in the link that is created here: '%1$s posted an important new <a href="%2$s">** Alert **</a>'
— where it would be like “soandso posted an important new Alert:The Title of the CPT”
Any ideas out there?
If this is still not the right/best way to accomplish this, I’m open to suggestion. But I think I am at least stepping in the right direction.
Thanks.