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

Parameters

$topic_id

(int) (Optional) Topic id

Return

(string) Topic freshness link

Source

File: bp-forums/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 = __( 'No Replies', 'buddyboss' );

		return apply_filters( 'bbp_get_topic_freshness_link', $anchor, $topic_id, $time_since, $link_url, $title );
	}

Changelog

Changelog
Version Description
bbPress (r2625) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.