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 );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | bbPress (r6308) Add 'redirect_to' support |
| 2.5.0 | Introduced. |