bb_get_tag_remove_link

The BuddyPress bb get tag remove link function.

Description

bb_get_tag_remove_link( (null) $args = null ); 

Parameters (1)

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

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_tag_remove_link( $args = null ) { 
  2. if ( is_scalar($args) || is_object( $args ) ) 
  3. $args = array( 'tag' => $args ); 
  4. $defaults = array( 'tag' => 0, 'topic' => 0, 'list_id' => 'tags-list' ); 
  5. $args = wp_parse_args( $args, $defaults ); 
  6. extract( $args, EXTR_SKIP ); 
  7.  
  8. if ( is_object( $tag ) && isset( $tag->tag_id ) ); // [sic] 
  9. elseif ( !$tag = bb_get_tag( bb_get_tag_id( $tag ) ) ) 
  10. return false; 
  11. if ( !$topic = get_topic( get_topic_id( $topic ) ) ) 
  12. return false; 
  13. if ( !bb_current_user_can( 'edit_tag_by_on', $tag->user_id, $topic->topic_id ) ) 
  14. return false; 
  15. $url = bb_get_uri('tag-remove.php', array('tag' => $tag->tag_id, 'user' => $tag->user_id, 'topic' => $topic->topic_id) ); 
  16. $url = esc_url( bb_nonce_url( $url, 'remove-tag_' . $tag->tag_id . '|' . $topic->topic_id) ); 
  17. $title = esc_attr__( 'Remove this tag' ); 
  18. $list_id = esc_attr( $list_id ); 
  19. return "[<a href='$url' class='delete:$list_id:tag-{$tag->tag_id}_{$tag->user_id}' title='$title'>×</a>]";