Changeset 10490
- Timestamp:
- 02/01/2016 07:25:42 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-phpmailer.php
r10488 r10490 18 18 19 19 /** 20 * Constructor.21 *22 * @since 2.5.023 */24 public function __construct() {25 global $phpmailer;26 27 // We'll try to use the PHPMailer object that might have been created by WordPress.28 if ( ! ( $phpmailer instanceof PHPMailer ) ) {29 require_once ABSPATH . WPINC . '/class-phpmailer.php';30 require_once ABSPATH . WPINC . '/class-smtp.php';31 $phpmailer = new PHPMailer( true );32 }33 }34 35 /**36 20 * Send email(s). 37 21 * … … 42 26 */ 43 27 public function bp_email( BP_Email $email ) { 44 global $phpmailer; 28 static $phpmailer = null; 29 30 if ( $phpmailer === null ) { 31 if ( ! class_exists( 'PHPMailer' ) ) { 32 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 33 require_once ABSPATH . WPINC . '/class-smtp.php'; 34 } 35 36 $phpmailer = new PHPMailer( true ); 37 } 38 45 39 46 40 /*
Note: See TracChangeset
for help on using the changeset viewer.