Replace "new SettingsController()" with fetch from DI container

[MAILPOET-2436]
This commit is contained in:
Jan Jakeš
2019-10-24 10:48:58 +02:00
committed by Jack Kitterhing
parent c91cd1255a
commit d970dda637
79 changed files with 132 additions and 125 deletions

View File

@@ -65,7 +65,7 @@ class Link {
static function processUrl($action, $url, $queue, $wp_user_preview = false) {
if ($wp_user_preview) return $url;
$settings = new SettingsController();
$settings = SettingsController::getInstance();
return ($queue !== false && (boolean)$settings->get('tracking.enabled')) ?
self::getFullShortcode($action) :
$url;
@@ -77,7 +77,7 @@ class Link {
$subscription_url_factory = SubscriptionUrlFactory::getInstance();
switch ($shortcode_action) {
case 'subscription_unsubscribe_url':
$settings = new SettingsController();
$settings = SettingsController::getInstance();
// track unsubscribe event
if ((boolean)$settings->get('tracking.enabled') && !$wp_user_preview) {
$unsubscribe_event = new Unsubscribes();