mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
(experimental) added framework for filtering all sorts of internals in discourse and consuming by plugins
This commit is contained in:
parent
8afff108bf
commit
b0465c517e
4 changed files with 78 additions and 1 deletions
18
lib/plugin/filter.rb
Normal file
18
lib/plugin/filter.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require_dependency 'plugin/filter_manager'
|
||||
# this concept is borrowed straight out of wordpress
|
||||
module Plugin
|
||||
class Filter
|
||||
def self.manager
|
||||
@manager ||= FilterManager.new
|
||||
end
|
||||
|
||||
def self.register(name, &blk)
|
||||
manager.register(name, &blk)
|
||||
end
|
||||
|
||||
def self.apply(name, context, result)
|
||||
manager.apply(name, context, result)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue