bbp_get_topic_tag_edit_link

Return the link of the current tag.

Description

(string) bbp_get_topic_tag_edit_link( (string) $tag = '' ); 

Returns (string)

Term Name

Parameters (1)

0. $tag — Optional. (string) => ''
The tag.

Usage

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

Defined (1)

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

/includes/topics/template.php  
  1. function bbp_get_topic_tag_edit_link( $tag = '' ) { 
  2. global $wp_rewrite; 
  3.  
  4. // Get the term 
  5. if ( ! empty( $tag ) ) { 
  6. $term = get_term_by( 'slug', $tag, bbp_get_topic_tag_tax_id() ); 
  7. } else { 
  8. $tag = get_query_var( 'term' ); 
  9. $term = get_queried_object(); 
  10.  
  11. // Add before and after if description exists 
  12. if ( !empty( $term->term_id ) ) { 
  13.  
  14. $bbp =bbpress); 
  15.  
  16. // Pretty 
  17. if ( $wp_rewrite->using_permalinks() ) { 
  18. $retval = user_trailingslashit( trailingslashit( bbp_get_topic_tag_link() ) . $bbp->edit_id ); 
  19.  
  20. // Ugly 
  21. } else { 
  22. $retval = add_query_arg( array( $bbp->edit_id => '1' ), bbp_get_topic_tag_link() ); 
  23.  
  24. // No link 
  25. } else { 
  26. $retval = ''; 
  27.  
  28. return apply_filters( 'bbp_get_topic_tag_edit_link', $retval, $tag );