diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index f9eb001216..0d6dc14a24 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -588,23 +588,25 @@ class VisualEditorHooks { ] ]; - $preferences['visualeditor-newwikitext'] = [ - 'version' => '1.0', - 'label-message' => 'visualeditor-preference-newwikitexteditor-label', - 'desc-message' => 'visualeditor-preference-newwikitexteditor-description', - 'screenshot' => [ - 'ltr' => "$iconpath/betafeatures-icon-WikitextEditor-ltr.svg", - 'rtl' => "$iconpath/betafeatures-icon-WikitextEditor-rtl.svg", - ], - 'info-message' => 'visualeditor-preference-newwikitexteditor-info-link', - 'discussion-message' => 'visualeditor-preference-newwikitexteditor-discussion-link', - 'requirements' => [ - 'javascript' => true, - 'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ), - 'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ), - ], - 'exempt-from-auto-enrollment' => true - ]; + if ( $veConfig->get( 'VisualEditorEnableWikitext' ) ) { + $preferences['visualeditor-newwikitext'] = [ + 'version' => '1.0', + 'label-message' => 'visualeditor-preference-newwikitexteditor-label', + 'desc-message' => 'visualeditor-preference-newwikitexteditor-description', + 'screenshot' => [ + 'ltr' => "$iconpath/betafeatures-icon-WikitextEditor-ltr.svg", + 'rtl' => "$iconpath/betafeatures-icon-WikitextEditor-rtl.svg", + ], + 'info-message' => 'visualeditor-preference-newwikitexteditor-info-link', + 'discussion-message' => 'visualeditor-preference-newwikitexteditor-discussion-link', + 'requirements' => [ + 'javascript' => true, + 'blacklist' => $veConfig->get( 'VisualEditorBrowserBlacklist' ), + 'skins' => $veConfig->get( 'VisualEditorSupportedSkins' ), + ], + 'exempt-from-auto-enrollment' => true + ]; + } }