bp_get_email

Filters the BP_Email object returned by bp_get_email().

Description

apply_filters( 'bp_get_email', (BP_Email) $email, (string) $email_type, (array) $args, (WP_Post) $post ); 

Parameters (4)

0. $email (BP_Email)
An object representing a single email, ready for mailing.
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. $email = apply_filters( 'bp_get_email', $email, $email_type, $args, $post ); 
  2.  
  3. if ( !empty( $email ) ) { 
  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 callback 
  2. function filter_bp_get_email( $email, $email_type, $args, $post ) { 
  3. // make filter magic happen here... 
  4. return $email
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_get_email', 'filter_bp_get_email', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_get_email', 'filter_bp_get_email', 10, 4 ); 

Defined (1)

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

/bp-core/bp-core-functions.php  
  1. $retval = apply_filters( 'bp_get_email', $email, $email_type, $args, $post );