You can filter 'bp_get_activity_latest_update_excerpt'
. Sample code, not tested, you will need my function utf8_truncate()
:
add_filter( 'bp_get_activity_latest_update_excerpt', 'wpse_56860_trim_buddypress_excerpt' );
function wpse_56860_trim_buddypress_excerpt( $excerpt )
{
// Number of characters to show. Adjust this to your needs.
$length = 80;
// Fix BuddyPress’ wrong quotes.
return _x( '“', 'opening curly double quote' )
. utf8_truncate( $excerpt, $length )
. _x( '”', 'closing curly double quote' );
}
Update
There is an alternative: create a hovercard.php
in your theme, the plugin will use this file then instead of the same named file in the plugin directory. In hovercard.php
change the line bp_member_latest_update( 'length=10' )
to get the proper length or add the filter at the top of the file and remove it after the last endif;
:
<?php if ( bp_has_members( "include={$_POST['userid']}&max=1") ) :
add_filter( 'bp_get_activity_latest_update_excerpt', 'wpse_56860_trim_buddypress_excerpt', 8 );
?>
// lots of stuff
<?php endif;
remove_filter( 'bp_get_activity_latest_update_excerpt', 'wpse_56860_trim_buddypress_excerpt', 8 );