bbp_update_reply_to

Update the reply's meta data with its reply to id.

Description

bbp_update_reply_to( (int) $reply_id = 0, (int) $reply_to = 0 ); 

Parameters (2)

0. $reply_id — Optional. (int)
Reply id to update
1. $reply_to — Optional. (int)
Reply to id

Usage

  1. if ( !function_exists( 'bbp_update_reply_to' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/replies/functions.php'; 
  3.  
  4. // Reply id to update 
  5. $reply_id = -1; 
  6.  
  7. // Optional. Reply to id 
  8. $reply_to = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bbp_update_reply_to($reply_id, $reply_to); 
  12.  

Defined (1)

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

/includes/replies/functions.php  
  1. function bbp_update_reply_to( $reply_id = 0, $reply_to = 0 ) { 
  2.  
  3. // Validation 
  4. $reply_id = bbp_get_reply_id( $reply_id ); 
  5. $reply_to = bbp_validate_reply_to( $reply_to ); 
  6.  
  7. // Update or delete the `reply_to` postmeta 
  8. if ( ! empty( $reply_id ) ) { 
  9.  
  10. // Update the reply to 
  11. if ( !empty( $reply_to ) ) { 
  12. update_post_meta( $reply_id, '_bbp_reply_to', $reply_to ); 
  13.  
  14. // Delete the reply to 
  15. } else { 
  16. delete_post_meta( $reply_id, '_bbp_reply_to' ); 
  17.  
  18. return (int) apply_filters( 'bbp_update_reply_to', (int) $reply_to, $reply_id );