From e868538be77c97995a67588f6b41278b84fe204d Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 16 Feb 2023 14:42:35 -0500 Subject: [PATCH] lets do this --- staging_mail_disable.php | 27 +++++++++++++++++++++++++++ wp-staging-plugin-disabler.php | 1 - 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 staging_mail_disable.php diff --git a/staging_mail_disable.php b/staging_mail_disable.php new file mode 100644 index 0000000..9cad02f --- /dev/null +++ b/staging_mail_disable.php @@ -0,0 +1,27 @@ +'staging']; +$plugins = ['fluent-smtp/fluent-smtp.php']; + +//Loop through our constants requirements +foreach($constant_requirements as $constant => $requirement) +{ + if (constant($constant) === $requirement) + { + add_filter('pre_wp_mail', 'staging_mail_disabler'); + } +} + +function staging_mail_disabler() { + return false; +} \ No newline at end of file diff --git a/wp-staging-plugin-disabler.php b/wp-staging-plugin-disabler.php index 4025338..32aad5c 100644 --- a/wp-staging-plugin-disabler.php +++ b/wp-staging-plugin-disabler.php @@ -25,4 +25,3 @@ foreach($constant_requirements as $constant => $requirement) break; // We only need one constant requirement to be meet } } -