bbp_get_reply_edit_url

Return URL to the reply edit page.

Description

(string) bbp_get_reply_edit_url( (int) $reply_id = 0 ); 

Returns (string)

Reply edit url

Parameters (1)

0. $reply_id — Optional. (int)
Reply id

Usage

  1. if ( !function_exists( 'bbp_get_reply_edit_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/replies/template.php'; 
  3.  
  4. // Optional. Reply id 
  5. $reply_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_reply_edit_url($reply_id); 
  9.  

Defined (1)

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

/includes/replies/template.php  
  1. function bbp_get_reply_edit_url( $reply_id = 0 ) { 
  2. global $wp_rewrite; 
  3.  
  4. $bbp =bbpress); 
  5. $reply = bbp_get_reply( bbp_get_reply_id( $reply_id ) ); 
  6. if ( empty( $reply ) ) 
  7. return; 
  8.  
  9. $reply_link = bbp_remove_view_all( bbp_get_reply_permalink( $reply_id ) ); 
  10.  
  11. // Pretty permalinks 
  12. if ( $wp_rewrite->using_permalinks() ) { 
  13. $url = trailingslashit( $reply_link ) . $bbp->edit_id; 
  14. $url = trailingslashit( $url ); 
  15.  
  16. // Unpretty permalinks 
  17. } else { 
  18. $url = add_query_arg( array( bbp_get_reply_post_type() => $reply->post_name, $bbp->edit_id => '1' ), $reply_link ); 
  19.  
  20. // Maybe add view all 
  21. $url = bbp_add_view_all( $url ); 
  22.  
  23. return apply_filters( 'bbp_get_reply_edit_url', $url, $reply_id );