getUrl()); exit(); } if ('new' === $_GET['donationFormID']) { // Make sure the Form will be created using the proper locale $locale = $_GET['locale'] ?? ''; Language::switchToLocale($locale); $form = new DonationForm([ 'title' => __('Donation Form', 'give'), 'status' => DonationFormStatus::DRAFT(), 'settings' => FormSettings::fromArray([ 'enableDonationGoal' => true, 'goalAmount' => 1000, 'inheritCampaignColors' => true, ]), 'blocks' => (new GenerateDefaultDonationFormBlockCollection())(), ]); Hooks::doAction('givewp_form_builder_new_form', $form); $form->save(); wp_redirect(FormBuilderRouteBuilder::makeEditFormRoute($form->id, $locale)->getUrl()); exit(); } } } }