hasPrimaryInput = true; parent::__construct($settings, $params, $children); } public function renderContent(Renderer $renderer, EvaluationContext $context) { //buildInputElement() is safe, and we intentionally allow HTML in the label and description. //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo ''; //phpcs:enable } public function isChecked() { if ( $this->mainBinding instanceof AbstractSetting ) { return boolval($this->mainBinding->getValue()); } return false; } public function includesOwnLabel(): bool { return true; } protected function getKoComponentParams(EvaluationContext $context): array { return array_merge( parent::getKoComponentParams($context), [ 'onValue' => true, 'offValue' => false, ] ); } }