bb_get_topic_move_dropdown

The BuddyPress bb get topic move dropdown function.

Description

bb_get_topic_move_dropdown( (string) $args = '' ); 

Parameters (1)

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

Usage

  1. if ( !function_exists( 'bb_get_topic_move_dropdown' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The args. 
  5. $args = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_topic_move_dropdown($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_topic_move_dropdown( $args = '' ) 
  2. if ( $args && is_numeric( $args ) ) { 
  3. $args = array( 'id' => (integer) $args ); 
  4.  
  5. $defaults = array( 'id' => 0, 'before' => '[', 'after' => ']' ); 
  6. extract(wp_parse_args( $args, $defaults ), EXTR_SKIP); 
  7. $id = (int) $id; 
  8.  
  9. $topic = get_topic( get_topic_id( $id ) ); 
  10. if ( !bb_current_user_can( 'move_topic', $topic->topic_id ) ) 
  11. return; 
  12.  
  13. $dropdown = bb_get_forum_dropdown( array( 
  14. 'callback' => 'bb_current_user_can',  
  15. 'callback_args' => array('move_topic', $topic->topic_id),  
  16. 'selected' => $topic->forum_id,  
  17. 'tab' => false 
  18. ) ); 
  19.  
  20. if ( !$dropdown ) 
  21. return; 
  22.  
  23. $r = $before . '<form id="topic-move" method="post" action="' . bb_get_uri( 'bb-admin/topic-move.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ) . '"><fieldset><div>' . "\n"; 
  24. $r .= '<input type="hidden" name="topic_id" value="' . $topic->topic_id . '" />' . "\n"; 
  25. $r .= '<label for="forum-id">'. __( 'Move to' ) . '</label>' . "\n"; 
  26. $r .= $dropdown . "\n"; 
  27. $r .= bb_nonce_field( 'move-topic_' . $topic->topic_id, '_wpnonce', true , false ); 
  28. $r .= '<input type="submit" name="Submit" value="' . __( 'Move' ) . '" />' . "\n"; 
  29. $r .= '</div></fieldset></form>' . $after; 
  30.  
  31. return $r;