add_filter() static public method

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
ファイル: php-content.php プロジェクト: rsms/gitblog
 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;
     }
 }