public static function get_instance(WPCF7_ContactForm $contact_form = null) { if (empty(self::$instance)) { if (null == $contact_form) { return null; } self::$instance = new self(); self::$instance->contact_form = $contact_form; self::$instance->skip_mail = $contact_form->in_demo_mode(); self::$instance->setup_posted_data(); self::$instance->submit(); } elseif (null != $contact_form) { return null; } return self::$instance; }