Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/15/2016 07:12:42 PM (9 years ago)
Author:
imath
Message:

Make sure the BuddyPress Email template can be loaded within the WordPress Administration.

bp_locate_template() is only loading templates if WP_USE_THEMES is defined or if an Ajax request is done, which is not the case inside a regular Administration page. As the email template is a required parameter for the BP_Email class, this was preventing any email to be sent from the WordPress Administration (eg: the activation email using the "resend" action from the Signups screen).
To fix this we are introducing a new filter the BP_Email class is using to get the email template.

Fixes #6912

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-email.php

    r10491 r10594  
    736736
    737737            // Load the template.
     738            add_filter( 'bp_locate_template_and_load', '__return_true' );
     739
    738740            bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
     741
     742            remove_filter( 'bp_locate_template_and_load', '__return_true' );
     743
    739744            $this->set_template( ob_get_contents() );
    740745
Note: See TracChangeset for help on using the changeset viewer.