bbp_get_forum_subscription_link

Get the forum subscription link.

Description

bbp_get_forum_subscription_link( (array) $args = array() ); 

A custom wrapper for bbp_get_user_subscribe_link()

Parameters (1)

0. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'bbp_get_forum_subscription_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/forums/template.php'; 
  3.  
  4. // The args. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_forum_subscription_link($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/forums/template.php  
  1. function bbp_get_forum_subscription_link( $args = array() ) { 
  2.  
  3. // No link 
  4. $retval = false; 
  5.  
  6. // Parse the arguments 
  7. $r = bbp_parse_args( $args, array( 
  8. 'forum_id' => 0,  
  9. 'user_id' => 0,  
  10. 'before' => '',  
  11. 'after' => '',  
  12. 'subscribe' => __( 'Subscribe', bbpress ),  
  13. 'unsubscribe' => __( 'Unsubscribe', bbpress ) 
  14. ), 'get_forum_subscribe_link' ); 
  15.  
  16. // No link for categories until we support subscription hierarchy 
  17. // @see http://bbpress.trac.wordpress.org/ticket/2475 
  18. if ( ! bbp_is_forum_category() ) { 
  19. $retval = bbp_get_user_subscribe_link( $r ); 
  20.  
  21. return apply_filters( 'bbp_get_forum_subscribe_link', $retval, $r );