Word break for long words

Can I use this code with Kirby v2, or does it need some modification? Also where does it go in the Kirby file structure? The plugin folder?

<?php
Kirby::plugin('medienbaecker/shy', [
	'hooks' => [
  	'kirbytags:before' => function ($text, $data, $options) {
			return Str::replace($text, "(-)", "&shy;");
		}
	]
]);

Source: https://medium.com/@medienbaecker/kreatives-unternehmertum-website-relaunch-with-kirby-3-c15579ba2e5

The Kirby::plugin syntax doesn’t work with Kirby 2, nor is there a kirbytags:before hook. Use a Kirbytext-pre filter instead.

http://k2.getkirby.com/docs/developer-guide/kirbytext/filters

Thank you @texnixe, quick as always. :slight_smile: