GUMP::add_filter PHP Method

add_filter() public static method

Adds a custom filter using a callback function.
public static add_filter ( string $rule, callable $callback ) : boolean
$rule string
$callback callable
return boolean
    public static function add_filter($rule, $callback)
    {
        $method = 'filter_' . $rule;
        if (method_exists(__CLASS__, $method) || isset(self::$filter_methods[$rule])) {
            throw new Exception("Filter rule '{$rule}' already exists.");
        }
        self::$filter_methods[$rule] = $callback;
        return true;
    }