add_filter() статический публичный Метод

Lower number for $priority means earlier execution of $func. If $func returns boolean FALSE the filter chain is broken, not applying any more filter after the one returning FALSE. Returning anything else have no effect.
static public add_filter ( $tag, $func, $priority = 100 )
Пример #1
0
 static function init($context)
 {
     if ($context === 'rebuild') {
         gb::observe('did-parse-object-meta', array(__CLASS__, 'check_content'));
         gb_cfilter::add('body.html', array(__CLASS__, 'escape_php'), 0);
         gb_cfilter::add('body.html', array(__CLASS__, 'unescape_php'), 9000);
         return true;
     } elseif ($context === 'request') {
         gb::add_filter('post-body', array(__CLASS__, 'eval_body'));
         return true;
     }
 }