src/View/Extensions/WordPress.php
public function getFilters()
    {
        return [
            /**
             * Formatting filters.
             */
            new \Twig_Filter('wpantispam', function ($email, $encoding = 0) {
                return antispambot($email, $encoding);
            }),
            new \Twig_Filter('wpautop', function ($text, $br = true) {
                return wpautop($text, $br);
            }),
            new \Twig_Filter('wpnofollow', function ($text) {
                return wp_rel_nofollow($text);
            }),
            new \Twig_Filter('wptrimexcerpt', function ($text) {
                return wp_trim_excerpt($text);
            }),
            new \Twig_Filter('wptrimwords', function ($text, $num_words = 55, $more = null) {
                return wp_trim_words($text, $num_words, $more);
            }),
            new \Twig_Filter('zeroise', function ($number, $treshold = 4) {
                return zeroise($number, $treshold);
            })
        ];
    }
public function getFilters()
    {
        return [
            /**
             * Formatting filters.
             */
            new \Twig_Filter('wpantispam', function ($email, $encoding = 0) {
                return antispambot($email, $encoding);
            }),
            new \Twig_Filter('wpautop', function ($text, $br = true) {
                return wpautop($text, $br);
            }),
            new \Twig_Filter('wpnofollow', function ($text) {
                return wp_rel_nofollow($text);
            }),
            new \Twig_Filter('wptrimexcerpt', function ($text) {
                return wp_trim_excerpt($text);
            }),
            new \Twig_Filter('wptrimwords', function ($text, $num_words = 55, $more = null) {
                return wp_trim_words($text, $num_words, $more);
            }),
            new \Twig_Filter('zeroise', function ($number, $treshold = 4) {
                return zeroise($number, $treshold);
            })
        ];
    }
public function getFilters ( ) { return [ /**
             * Formatting filters.
             */ new \ Twig_Filter ( 'wpantispam' , function ( $ email , $ encoding = 0 ) { return antispambot ( $ email , $ encoding ) ; } ) , new \ Twig_Filter ( 'wpautop' , function ( $ text , $ br = true ) { return wpautop ( $ text , $ br ) ; } ) , new \ Twig_Filter ( 'wpnofollow' , function ( $ text ) { return wp_rel_nofollow ( $ text ) ; } ) , new \ Twig_Filter ( 'wptrimexcerpt' , function ( $ text ) { return wp_trim_excerpt ( $ text ) ; } ) , new \ Twig_Filter ( 'wptrimwords' , function ( $ text , $ num_words = 55 , $ more = null ) { return wp_trim_words ( $ text , $ num_words , $ more ) ; } ) , new \ Twig_Filter ( 'zeroise' , function ( $ number , $ treshold = 4 ) { return zeroise ( $ number , $ treshold ) ; } ) ] ; }
Register a list of WordPress filters for use
inside Twig templates.

@return array|\Twig_Filter[]
Register a list of WordPress filters for use inside Twig templates .