Mity Docs Mity Docs for Mity Digital
Form Submission Cleaner Documentation

Forms

When you install Form Submission Cleaner for Statamic, it will apply its cleanup logic to all of your forms. In the config file, check out the forms option:

You can change this to be:

  • all, for all forms,

  • a handle for a single form using all defaults,

  • an array of handles for defaults to selected forms, or

  • an array of handles and overrides to get granular control

All forms

Set to all to apply the default options to all Forms.

1'forms' => 'all',

A single form

You can set the forms option to a single form handle. The default options will apply to that form.

1'forms' => 'my_form_handle',

Multiple forms

You can set the forms option to an array of form handles. The default options will apply to all forms.

1'forms' => [
2 'form_handle',
3 'another_form_handle',
4],

Overriding defaults

There may be times where you want to clean up selected forms only, using the default options for most, but overriding default options for one form. That's easy too!

You can set a key/value array with the key being the form handle, and the value being an array of overrides. Any missing options will be filled in with the defaults automagically.

1'forms' => [
2 'form_handle' => [
3 'days' => 7,
4 ]
5],

This will use the defaults for delete_assets, delete_submissions and query_scopes, but change the number of days to 7.

You can also be a bit mixed about it too - using defaults for one form but specifying an override for another:

1'forms' => [
2 'form_handle' => [
3 'days' => 7,
4 ],
5 'another_form_handle',
6],

This will apply all defaults to the another_form_handle form, but do the same override we did above to the form_handle form.