The ‘Recent Topics’ widget even though it can include ‘Recent Replies’ the widget itself only outputs topic links. The ‘Recent Replies’ widget does link to the most recent reply id.
I also read your comments on the Trac tickets, we will get the widgets updated, the performance improvements we are making for bbPress 2.6 will most likely affect the widgets also, so we will take a look at the widget tickets at the same time.
As somebody who can bodge/program (quite) basic php code, do you think I could modify this and add a link or might it be difficult? You could potentially save me wasting hours or days of my life trying in futility!
Thank you.
It’s OK I have nearly got this working. I will post the code soon for anybody who would like it.
In wp-content/plugins/bbpress/includes/common/widgets.php
At around line 807 I added some code from the recent replies widget:
// Verify the reply ID - TESTING
$reply_id = bbp_get_reply_id( $widget_query->post->ID );
$reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '"> TEST</a>';
// END TESTING
Then near line 830 I changed
<div><?php bbp_topic_last_active_time( $topic_id ); ?></div>
to include the code to print the “recent reply” link after the date/time.
<div><?php bbp_topic_last_active_time( $topic_id );
//print latest reply link
printf( _x( '%1$s', 'widgets', 'bbpress' ), $reply_link);
?></div>
Oh to change your recent reply link text, for anyone who is more of a newbie than myself, you change the word TEST in the $reply_link line – change this to whatever, I think will use an (little arrow)…
sorry. it doesnt work after all.
The URLS now show a post id, which made me think it was linking to the most recent reply. But it still just goes to the beginning 🙁
Many of my topics are dozens of pages long and people want to go to the most recent reply.
Hi, I would like this feature too. Does anyone have a solution to modify this? The ‘Recent Replies’ widget doesn’t suit me.
@welshdemon: Did you solve it? 🙂
I’m pretty sure that the link in the ‘latest activity’ widget in my style pack takes you to the reply
bbp style pack
once activated you’ll find a latest activity widget with lots of settings you can use.
@robin-w: Thank you very much! It works perfectly!
great – glad you are fixed