private function add_error($message) { if (!is_object($this->error) || !is_a($this->error, 'WP_Error')) { $this->error = new WP_Error(); } $this->error->add('addon_error', $message); }