bp_get_email_post

Filters arguments used to create the BP_Email object.

Description

apply_filters( 'bp_get_email_post', (WP_Post) $post_0, (string) $email_type, (array) $args, (WP_Post) $post ); 

Parameters (4)

0. $post_0 (WP_Post)
Post object containing the contents of the email.
1. $email_type (string)
Unique identifier for a particular type of email.
2. $args (array)
Arguments used with get_posts() to fetch a post object.
3. $post (WP_Post)
All posts retrieved by get_posts( $args ). May only contain $post.

Usage

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

Defined (1)

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

/bp-core/bp-core-functions.php  
  1. $post = apply_filters( 'bp_get_email_post', $post[0], $email_type, $args, $post );