(This is for D8, although parts of this filter settings API were already in D7.)
As far as I understand, a filter plugin exposes its settings solely with FilterBase::settingsForm()
- the central architecture then automatically stores the submitted form values and loads them when creating the plugin instance, so that a filter plugin can find them in $this->settings
.
I'd like to reorganize and clean up the submitted form values before they're stored, but I'm not sure where to intercept the form. Should I attach a #validate or a #submit? If the latter, how do I ensure that my #submit runs before FilterFormatInterface::submitForm()
?