Twig can be extended in many ways; you can add extra tags, filters, tests, operators, global variables, and functions. You can even extend the parser itself with node visitors. In this blog,
I am going to show you how to create new custom twig filters in WordPress. For example we are going to create a filter to remove numbers from string, will explain with hello_world plugin.
Create hello_world folder in plugins/custom/ folder with the following files,
Source: New feed