hasPrimaryInput = true; parent::__construct($settings, $params); } public function renderContent(Renderer $renderer) { //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->mainSetting instanceof Setting ) { return boolval($this->mainSetting->getValue()); } return false; } public function includesOwnLabel() { return true; } protected function getKoComponentParams() { return array_merge( parent::getKoComponentParams(), [ 'onValue' => true, 'offValue' => false, ] ); } }