public function addFilter( $filter, $callback, $priority = 10 )
    {
        if ( !isset( $this->filters[ $filter ] ) )
        {
            $this->filters[ $filter ] = array();
        }

        $this->filters[ $filter ][] = array(
            'priority' => $priority,
            'callback' => $callback,
        );

        if ( 1 < count( $this->filters[ $filter ] ) )
        {
            usort( $this->filters[ $filter ], array( $this, '_sortByPriority' ) );
        }

        if ( $this->debug )
        {
            echo PHP_EOL . '+FILTER: ' . $filter . ' -> '
                    . $this->_serializeCallback( $callback )
                    . ' + Priority: ' . $priority . PHP_EOL;
        }
    }
public function addFilter( $filter, $callback, $priority = 10 )
    {
        if ( !isset( $this->filters[ $filter ] ) )
        {
            $this->filters[ $filter ] = array();
        }

        $this->filters[ $filter ][] = array(
            'priority' => $priority,
            'callback' => $callback,
        );

        if ( 1 < count( $this->filters[ $filter ] ) )
        {
            usort( $this->filters[ $filter ], array( $this, '_sortByPriority' ) );
        }

        if ( $this->debug )
        {
            echo PHP_EOL . '+FILTER: ' . $filter . ' -> '
                    . $this->_serializeCallback( $callback )
                    . ' + Priority: ' . $priority . PHP_EOL;
        }
    }
public function addFilter ( $ filter , $ callback , $ priority = 10 ) { if ( ! isset ( $ this -> filters [ $ filter ] ) ) { $ this -> filters [ $ filter ] = array ( ) ; } $ this -> filters [ $ filter ] [ ] = array ( 'priority' => $ priority , 'callback' => $ callback , ) ; if ( 1 < count ( $ this -> filters [ $ filter ] ) ) { usort ( $ this -> filters [ $ filter ] , array ( $ this , '_sortByPriority' ) ) ; } if ( $ this -> debug ) { echo PHP_EOL . '+FILTER: ' . $ filter . ' -> ' . $ this -> _serializeCallback ( $ callback ) . ' + Priority: ' . $ priority . PHP_EOL ; } }
Add a callback to execute to filter content.

@param string $filter   the filter name
@param mixed  $callback the callback [ function name, array ]
@param int    $priority the callback priority
Add a callback to execute to filter content .