إستخدم هذه الدالة:
\[php\]
/\*\*
\* Get the last active link in the forum.
\*
\* @since 1.0
\*/
function ArWP\_get\_forum\_last\_active\_link ( $forum\_id = 0 ) {
$forum\_id = bbp\_get\_forum\_id ( $forum\_id );
$active\_id = bbp\_get\_forum\_last\_active\_id ( $forum\_id );
if ( empty ( $active\_id ) )
$active\_id = bbp\_get\_forum\_last\_reply\_id ( $forum\_id );
if ( empty ( $active\_id ) )
$active\_id = bbp\_get\_forum\_last\_topic\_id ( $forum\_id );
if ( bbp\_is\_topic( $active\_id ) ) {
$link = apply\_filters( 'bbp\_get\_forum\_last\_topic\_permalink', bbp\_get\_topic\_permalink( $active\_id ), $forum\_id );
$title = apply\_filters( 'bbp\_get\_forum\_last\_topic\_title', bbp\_get\_topic\_title( $active\_id ), $forum\_id );
} elseif ( bbp\_is\_reply( $active\_id ) ) {
$link = apply\_filters( 'bbp\_get\_forum\_last\_reply\_permalink', bbp\_get\_reply\_url( $active\_id ), $forum\_id );
$title = apply\_filters( 'bbp\_get\_forum\_last\_reply\_title', bbp\_get\_reply\_title( $active\_id ) , $forum\_id );
} // end if
if ( empty ( $link ) ) {
$anchor = \_\_( 'No Topics', 'bbpress' );
} else {
$anchor = '<a href="' . esc\_url( $link ) . '">' . $title . '</a>';
} // end if
return apply\_filters( 'ArWP\_get\_forum\_freshness\_link', $anchor, $forum\_id );
} // end ArWP\_get\_forum\_freshness\_link()\[/php\]