Open GoogleCodeExporter opened 9 years ago
Original comment by ever...@fireproofsocks.com
on 13 May 2013 at 4:35
I think this is something that individual site-owners can do:
http://blog.slyspyder.com/2010/08/15/integrate-simplepress-forum-into-the-buddyp
ress-activity-stream/
But the documentation looks really sloppy... and so does the code. Do you
have an example of adding something like a post to a stream?
I don't have Buddypress installed so I don't think this one is going to get my
attention any time soon unfortunately.
Original comment by ever...@fireproofsocks.com
on 29 Jul 2013 at 8:02
I've achieved this myself. The code is relatively simple.
The 1st filter tells BP what events to log and the 2nd one adds the wording
that is displayed in the activity stream
// add custom post types to the activity stream
function activity_publish_custom_post_types($cpts) {
$cpts[] = 'documents';
return $cpts;
}
add_filter ( 'bp_blogs_record_post_post_types',
'activity_publish_custom_post_types' );
//Change wording in Activity Stream and use post_type instead of just of 'post'
add_filter( 'bp_blogs_activity_new_post_action', 'my_activity_content', 2, 10
);
function my_activity_content($activity_content, $post, $post_permalink){
$myPostType = $post->post_type;
$fullPermalink = $post->guid;
$activity_content = sprintf( __( '%s added a new '.$myPostType.': %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $fullPermalink . '">' . $post->post_title . '</a>' );
$activity_content .= " " . bp_create_excerpt( $post->post_content, 25 );
return $activity_content;
}
Original comment by pe...@twobytwo.co.uk
on 30 May 2014 at 4:18
Thanks for sharing your solution!
Original comment by ever...@fireproofsocks.com
on 30 May 2014 at 4:20
Original issue reported on code.google.com by
i...@brightongmc.org
on 13 May 2013 at 4:31