bbp_get_topic_subscription_link( $args = array() )

Get the topic subscription link


Description Description

A custom wrapper for bbp_get_user_subscribe_link()


Source Source

File: includes/topics/template.php

	function bbp_get_topic_subscription_link( $args = array() ) {

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

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

		// Get the link
		$retval = bbp_get_user_subscribe_link( $r );

		// Filter & return
		return apply_filters( 'bbp_get_topic_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.