Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements a functionality that prevents the sending of emails when using the
wp_mail
function to send emails.Why it’s required?
Blocking email functionality in the WordPress development environment is essential for testing, security, privacy, and efficiency purposes. It prevents unintended consequences, such as sending test emails to real users or exposing sensitive information. Additionally, it helps maintain a smooth development process by avoiding delays caused by email processing.
How it works?
This pull request introduces a plugin which override the
wp-mail
function, ensuring it is loaded at the start of the mu-plugins loading phase. This prevents other mu-plugins and plugins from overriding it. The default naming convention of this plugin is designed to ensure it is loaded early in the alphabetical loading order of mu-plugins, further enhancing its loading position within the mu-plugins loading phase.Plugin Information
Usage
In hosts.yml
true
, this will enable email blocking functionality.custom-mu-plugins
MU_PLUGIN_DIR
constant in your wp-config.php file to specify a custom path for mu-plugins, you can use this variable to install Block Emails into your custom mu-plugins directory.Example
Assuming you wish to block emails and have configured
MU_PLUGIN_DIR
to/var/www/htdocs/current/wp-content/custom-mu-plugins
.In workflow file
true
, this will enable email blocking functionality.Example
Assuming you wish to block emails and have configured
MU_PLUGIN_DIR
to/var/www/htdocs/current/wp-content/custom-mu-plugins
.