public function add_error($error) { if (!in_array($error, $this->errors)) { $this->errors[] = $error; $this->bridge->add_action('bwp_option_action_before_form', array($this, 'show_errors')); } }