Skip to content

Conversation

BrianHenryIE
Copy link

I see there is a notice on the plugins page, but I imagine most people just want to install and go.

In your conditional if (!function_exists('wp_mail')) { I've added else which uses reflection to find the file wp_mail has been declared in, then find what plugin that is in, then disable the plugin.

To test, you can add this as a plugin:

<?php
/**
 * Plugin Name:       A WP_Mail Dummy
 * Description:       A plugin whose name starts with "A" which sets a custom wp_mail function.
 * Text Domain:       a-wpmail-dummy
 */
if (!function_exists('wp_mail')) {
	function wp_mail( $to, $subject, $message, $headers = '', $attachments = [] ) {
		return true;
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant