Created
March 13, 2019 12:43
-
-
Save wpmudev-sls/2caff1b71e72429a9da69e84ceded34a to your computer and use it in GitHub Desktop.
[Membership - 2] - Disable the registration email on Subscriptions with the Manual gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: M2P Disable Email On Manual Account Creation | |
* Description: M2P Disable Email On Manual Account Creation | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/profile/tho2757 | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
add_action( 'plugins_loaded', 'wpmudev_ms_load_disable_email_func', 100 ); | |
function wpmudev_ms_load_disable_email_func(){ | |
if( defined('MS_IS_PRO') && MS_IS_PRO ){ | |
function wpmudev_ms_disable_all_email_on_manual_account( $member, $subscription, $comm ){ | |
if( 'admin' === $subscription->gateway_id ){ | |
$comm->enabled = false; | |
} | |
} | |
add_action( 'ms_model_communication_send_message_before', 'wpmudev_ms_disable_all_email_on_manual_account', 10, 3 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment