BuddyPress - How to display commenter username with displayname in
activity comments list
For an activity feed entry, I'd like to display each commentors USERNAME
as both;
a) the title= of their avatar link and
b) beside their display name
so that other commentors can @mention each other in the comments.
As you can see I've tried echo bp_get_activity_comment_username() - but it
doesn't seem to work and I can't find any other way to extract the
commentors username???
(This seems like it shold be part of the core. Why is it that you can
@mention someone but there's no way to know their username?? Seems odd.)
<div class="acomment-avatar">
<a href="<?php bp_activity_comment_user_link(); ?>" title="<?php echo
bp_get_activity_comment_username(); ?>">
<?php bp_activity_avatar( 'type=thumb&user_id=' .
bp_get_activity_comment_user_id() ); ?>
</a>
</div>
<div class="acomment-meta">
<?php
printf( __( '<a href="%1$s">%2$s</a> (%3$s) replied <a href="%4$s"
class="activity-time-since"><span class="time-since">%5$s</span></a>',
'buddypress' ), bp_get_activity_comment_user_link(),
bp_get_activity_comment_name(), bp_get_activity_comment_username(),
bp_get_activity_thread_permalink(),
bp_get_activity_comment_date_recorded() );
?>
</div>
No comments:
Post a Comment