bp_email_get_template

Get the paths to possible templates for the specified email object.

Description

(array) bp_email_get_template( (WP_Post) WP_Post $object ); 

Returns (array)

Parameters (1)

0. $object (WP_Post) => WP_Post $object
Post to get email template for.

Usage

  1. if ( !function_exists( 'bp_email_get_template' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4. // Post to get email template for. 
  5. $object = WP_Post $object; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_email_get_template($object); 
  9.  

Defined (1)

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

/bp-core/bp-core-functions.php  
  1. function bp_email_get_template( WP_Post $object ) { 
  2. $single = "single-{$object->post_type}"; 
  3.  
  4. /** 
  5. * Filter the possible template paths for the specified email object. 
  6. * @since 2.5.0 
  7. * @param array $value Array of possible template paths. 
  8. * @param WP_Post $object WP_Post object. 
  9. */ 
  10. "{$single}-{$object->post_name}.php",  
  11. "{$single}.php",  
  12. "assets/emails/{$single}.php",  
  13. ), $object );