Only Optout, no optin default.
-
This is the offfical code:
protected function getOptinStatus()
{
$mailchimp_newsletter = new MailChimp_Newsletter();
// if the user has chosen to hide the checkbox, don't do anything.
if ( ( $default_setting = $mailchimp_newsletter->getOption('mailchimp_checkbox_defaults', 'check') ) === 'hide') {
return 'hide';
}
// if the user chose 'check' or nothing at all, we default to true.
$default_checked = $default_setting === 'check';
$status = $default_checked;
// if the user is logged in, we will pull the 'is_subscribed' property out of the meta for the value.
// otherwise we use the default settings.
if (is_user_logged_in()) {
$status = get_user_meta(get_current_user_id(), 'mailchimp_woocommerce_is_subscribed', true);
/// if the user is logged in - and is already subscribed - just ignore this checkbox.
if ($status === '' || $status === null) {
$status = $default_checked;
}
}
return $status === true || $status === '1' ? 'check' : 'uncheck';
}I mean, really?
$default_checked = $default_setting === ‘check’;
$status = $default_checked;why not adding an apply_fitlers there that we can change that to out-out (unckeck) as default?
Really frustrating that we cannot obide the law as for the plugin has not the option to do so, except breakt updates and modify the code.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.