bbp_get_forum_permalink( int $forum_id,  $redirect_to = '' )

Return the link to the forum

Description

Parameters

$forum_id

(int) (Optional) Forum id

$string

(Optional) $redirect_to Optional. Pass a redirect value for use with shortcodes and other fun things.

Return

(string) Permanent link to forum

Source

File: bp-forums/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 );
		}

		return apply_filters( 'bbp_get_forum_permalink', $forum_permalink, $forum_id );
	}

Changelog

Changelog
Version Description
bbPress (r2464) 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.