Hide setting behind feature flag

[MAILPOET-2284]
This commit is contained in:
Ján Mikláš
2019-09-24 11:37:42 +02:00
committed by Jack Kitterhing
parent 452552b14a
commit efcd7d6e1d
2 changed files with 12 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use MailPoet\AdminPages\PageRenderer;
use MailPoet\Config\Installer;
use MailPoet\Config\ServicesChecker;
use MailPoet\Cron\CronTrigger;
use MailPoet\Features\FeaturesController;
use MailPoet\Models\Segment;
use MailPoet\Models\Subscriber;
use MailPoet\Services\Bridge;
@ -37,6 +38,9 @@ class Settings {
/** @var Captcha */
private $captcha;
/** @var FeaturesController */
private $features_controller;
/** @var Installation */
private $installation;
@ -47,7 +51,8 @@ class Settings {
WPFunctions $wp,
ServicesChecker $services_checker,
Installation $installation,
Captcha $captcha
Captcha $captcha,
FeaturesController $features_controller
) {
$this->page_renderer = $page_renderer;
$this->settings = $settings;
@ -56,6 +61,7 @@ class Settings {
$this->services_checker = $services_checker;
$this->installation = $installation;
$this->captcha = $captcha;
$this->features_controller = $features_controller;
}
function render() {
@ -87,6 +93,9 @@ class Settings {
'smtp' => Hosts::getSMTPHosts(),
],
'built_in_captcha_supported' => $this->captcha->isSupported(),
'display_woocommerce_editor' => $this->features_controller->isSupported(
FeaturesController::WC_TRANSACTIONAL_EMAILS_CUSTOMIZER
),
];
$data['is_new_user'] = $this->installation->isNewInstallation();

View File

@ -1,4 +1,5 @@
<table class="form-table">
<% if display_woocommerce_editor %>
<tr>
<th scope="row">
<label for="settings[woocommerce_use_mailpoet_editor]">
@ -29,6 +30,7 @@
>
</td>
</tr>
<% endif %>
<tr>
<th scope="row">
<label for="settings[woocommerce_optin_on_checkout]">