Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Adding custom posts to activity- and changing the name of the activity action

@shanebp

Moderator

Your code is garbled and missing the href. Try this:

add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
function record_cpt_activity_action( $activity_action,  $post, $post_permalink ) { 

   if( $post->post_type == 'projects' ) {
	$activity_action  = sprintf( __( '%1$s created a new Project, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
   }
	
   return $activity_action;
}
Skip to toolbar