bbp_get_topic_freshness_link( int $topic_id )
Returns link to the most recent activity inside a topic, complete with link attributes and content.
Description Description
Parameters Parameters
- $topic_id
-
(Optional) Topic id
Return Return
(string) Topic freshness link
Source Source
File: includes/topics/template.php
function bbp_get_topic_freshness_link( $topic_id = 0 ) { $topic_id = bbp_get_topic_id( $topic_id ); $link_url = bbp_get_topic_last_reply_url( $topic_id ); $title = bbp_get_topic_last_reply_title( $topic_id ); $time_since = bbp_get_topic_last_active_time( $topic_id ); if ( ! empty( $time_since ) ) { $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $time_since ) . '</a>'; } else { $anchor = esc_html__( 'No Replies', 'bbpress' ); } // Filter & return return apply_filters( 'bbp_get_topic_freshness_link', $anchor, $topic_id, $time_since, $link_url, $title ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |