PluginProbe
Disable Emails / trunk
Disable Emails vtrunk
trunk 1.0.0 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.8.0 1.8.1 1.8.2 1.8.3
disable-emails / includes / bootstrap.php

bootstrap.php in Disable Emails trunk, at includes/bootstrap.php

33 lines 889 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use webaware\disable_emails\Plugin;
4 use webaware\disable_emails\PHPMailerMock;
5
6 if (!defined('ABSPATH')) {
7 exit;
8 }
9
10 require DISABLE_EMAILS_PLUGIN_ROOT . 'includes/functions.php';
11
12 // replace standard WordPress wp_mail() if nobody else has already done it
13 if (!function_exists('wp_mail')) {
14
15 require DISABLE_EMAILS_PLUGIN_ROOT . 'includes/class.EmailAddress.php';
16 require DISABLE_EMAILS_PLUGIN_ROOT . 'includes/class.PHPMailerMock.php';
17
18 function wp_mail( $to, $subject, $message, $headers = '', $attachments = [] ) {
19 global $phpmailer;
20
21 // create mock PHPMailer object to handle any filter and action hook listeners
22 $phpmailer = new PHPMailerMock();
23 return $phpmailer->wpmail($to, $subject, $message, $headers, $attachments);
24 }
25
26 }
27
28 /**
29 * kick start the plugin
30 */
31 require DISABLE_EMAILS_PLUGIN_ROOT . 'includes/class.Plugin.php';
32 Plugin::getInstance()->pluginStart();
33