static function add_form() { // Add a new form check_admin_referer('fs_contact_options-options', 'fs_options'); self::$global_options = FSCF_Util::get_global_options(); // Find the next form number // When forms are deleted, their form number is NOT reused self::$global_options['form_list'][self::$current_form] = __('New Form', 'si-contact-form'); // Highest form ID (used to assign ID to new form) // When forms are deleted, the remaining forms are NOT renumberd, so max_form_num might be greater than // the number of existing forms // recalibrate max_form_num to the highest form number (not count) ksort(self::$global_options['form_list']); self::$global_options['max_form_num'] = max(array_keys(self::$global_options['form_list'])); update_option('fs_contact_global', self::$global_options); echo '<div id="message" class="updated fade"><p>' . sprintf(__('Form %d has been added.', 'si-contact-form'), self::$current_form) . '</p></div>'; return; }