I need to “sanitize” some text from text input fields in Kirby 2, that means I would need to create some custom field methods using some preg_replace that are then available to me globally.
While there is documentation on how to create your own field methods in Kirby 3, I couldn’t find anything for Kirby 2? Is there a way to do this?
No, I don’t think so. You can create a custom class that extends the str class, but for only one function that probably wouldn’t make sense and a function would be more useful.