bp_forums_reply_exists

Filters whether a user has already left this particular reply on a given post.

Description

apply_filters( 'bp_forums_reply_exists', (bool) $reply_exists, (string) $text, (int) $topic_id, (int) $user_id ); 

Parameters (4)

0. $reply_exists (bool)
Whether or not a reply exists.
1. $text (string)
The text of the comment.
2. $topic_id (int)
The topic id.
3. $user_id (int)
The user id.

Usage

To run the hook, copy the example below.
  1. $reply_exists = apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id ); 
  2.  
  3. if ( !empty( $reply_exists ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_forums_reply_exists callback 
  2. function filter_bp_forums_reply_exists( $reply_exists, $text, $topic_id, $user_id ) { 
  3. // make filter magic happen here... 
  4. return $reply_exists
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_forums_reply_exists', 'filter_bp_forums_reply_exists', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_forums_reply_exists', 'filter_bp_forums_reply_exists', 10, 4 ); 

Defined (1)

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

/bp-forums/bp-forums-functions.php  
  1. return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );