diff --git src/bp-core/bp-core-template-loader.php src/bp-core/bp-core-template-loader.php
index 59330eb..87e2710 100644
|
|
function bp_locate_template( $template_names, $load = false, $require_once = tru |
126 | 126 | // Maybe load the template if one was located. |
127 | 127 | $use_themes = defined( 'WP_USE_THEMES' ) && WP_USE_THEMES; |
128 | 128 | $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; |
129 | | if ( ( $use_themes || $doing_ajax ) && ( true == $load ) && ! empty( $located ) ) { |
| 129 | |
| 130 | /** |
| 131 | * Filter here to allow/disallow template loading. |
| 132 | * |
| 133 | * @since 2.5.0 |
| 134 | * |
| 135 | * @param bool $value True to load the template, false otherwise. |
| 136 | */ |
| 137 | $load_template = (bool) apply_filters( 'bp_locate_template_and_load', $use_themes || $doing_ajax ); |
| 138 | |
| 139 | if ( $load_template && ( true == $load ) && ! empty( $located ) ) { |
130 | 140 | load_template( $located, $require_once ); |
131 | 141 | } |
132 | 142 | |
diff --git src/bp-core/classes/class-bp-email.php src/bp-core/classes/class-bp-email.php
index a399087..4f5e336 100644
|
|
class BP_Email { |
735 | 735 | ob_start(); |
736 | 736 | |
737 | 737 | // Load the template. |
| 738 | add_filter( 'bp_locate_template_and_load', '__return_true' ); |
| 739 | |
738 | 740 | bp_locate_template( bp_email_get_template( $this->post_object ), true, false ); |
| 741 | |
| 742 | remove_filter( 'bp_locate_template_and_load', '__return_true' ); |
| 743 | |
739 | 744 | $this->set_template( ob_get_contents() ); |
740 | 745 | |
741 | 746 | ob_end_clean(); |