bbp_get_topic_favorite_link

Get the forum favorite link.

Description

bbp_get_topic_favorite_link( (array) $args = array() ); 

A custom wrapper for bbp_get_user_favorite_link()

Parameters (1)

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

Usage

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

Defined (1)

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

/includes/topics/template.php  
  1. function bbp_get_topic_favorite_link( $args = array() ) { 
  2.  
  3. // No link 
  4. $retval = false; 
  5.  
  6. // Parse the arguments 
  7. $r = bbp_parse_args( $args, array( 
  8. 'user_id' => 0,  
  9. 'topic_id' => 0,  
  10. 'before' => '',  
  11. 'after' => '',  
  12. 'favorite' => __( 'Favorite', bbpress ),  
  13. 'favorited' => __( 'Unfavorite', bbpress ) 
  14. ), 'get_forum_favorite_link' ); 
  15.  
  16. // Get the link 
  17. $retval = bbp_get_user_favorites_link( $r ); 
  18.  
  19. return apply_filters( 'bbp_get_topic_favorite_link', $retval, $r );