lets do this
This commit is contained in:
parent
21314d8593
commit
e868538be7
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Staging Mail Disable
|
||||
Plugin URI: https://cooini.com/services/dev/wordpress
|
||||
Description: This plugin will disable will add a filter that prevents wordpress from sending mail
|
||||
Version: 1.0
|
||||
Author: sbyrd
|
||||
Author URI: https://cooini.com/
|
||||
License: MINE-all-mine
|
||||
*/
|
||||
|
||||
|
||||
$constant_requirements = ['WP_ENVIRONMENT_TYPE'=>'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;
|
||||
}
|
|
@ -25,4 +25,3 @@ foreach($constant_requirements as $constant => $requirement)
|
|||
break; // We only need one constant requirement to be meet
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue