bbp_get_forum_subscription_link( $args = array() )

Get the forum subscription link


Description Description

A custom wrapper for bbp_get_user_subscribe_link()


Source Source

File: includes/forums/template.php

	function bbp_get_forum_subscription_link( $args = array() ) {

		// Defaults
		$retval      = false;
		$redirect_to = bbp_is_subscriptions()
			? bbp_get_subscriptions_permalink()
			: '';

		// Parse the arguments
		$r = bbp_parse_args( $args, array(
			'user_id'     => bbp_get_current_user_id(),
			'object_id'   => bbp_get_forum_id(),
			'object_type' => 'post',
			'before'      => '',
			'after'       => '',
			'subscribe'   => esc_html__( 'Subscribe',   'bbpress' ),
			'unsubscribe' => esc_html__( 'Unsubscribe', 'bbpress' ),
			'redirect_to' => $redirect_to
		), 'get_forum_subscribe_link' );

		// No link for categories until we support subscription hierarchy
		// @see https://bbpress.trac.wordpress.org/ticket/2475
		if ( ! bbp_is_forum_category() ) {
			$retval = bbp_get_user_subscribe_link( $r );
		}

		// Filter & return
		return apply_filters( 'bbp_get_forum_subscribe_link', $retval, $r, $args );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 bbPress (r6308) Add 'redirect_to' support
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.