pre_post

The BuddyPress pre post hook.

Description

apply_filters( 'pre_post', (unknown) $post_text, (unknown) $post_id, (unknown) $topic_id ); 

Parameters (3)

0. $post_text (unknown)
The post text.
1. $post_id (unknown)
The post id.
2. $topic_id (unknown)
The topic id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-posts.php  
  1. if ( $run_filters && !$post_text = apply_filters('pre_post', $post_text, $post_id, $topic_id) )