bbp_get_forum_permalink( int $forum_id, string $redirect_to = '' )
Return the link to the forum
Description Description
Parameters Parameters
- $forum_id
-
(Optional) Forum id
- $redirect_to
-
(Optional) Pass a redirect value for use with shortcodes and other fun things.
Default value: ''
Return Return
(string) Permanent link to forum
Source Source
File: includes/forums/template.php
function bbp_get_forum_permalink( $forum_id = 0, $redirect_to = '' ) {
$forum_id = bbp_get_forum_id( $forum_id );
// Use the redirect address
if ( ! empty( $redirect_to ) ) {
$forum_permalink = esc_url_raw( $redirect_to );
// Use the topic permalink
} else {
$forum_permalink = get_permalink( $forum_id );
}
// Filter & return
return apply_filters( 'bbp_get_forum_permalink', $forum_permalink, $forum_id );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |