$value){ if(property_exists(self::class,$key)){ $this->$key = $value; } if(!empty($args['color'])){ $this->color_yes = $args['color']; $this->color_no = $args['color']; } if(empty($this->id)){ $this->id = uniqid(); } if(empty($this->name)){ $this->name = uniqid(); } } } public function render(){ require(get_template_directory()."/template-parts/components/toggle-button.php"); } }