mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Various Plugin Enhancements and Extension Points
This commit is contained in:
parent
841cec1bc1
commit
1006b1ba94
10 changed files with 82 additions and 19 deletions
|
@ -67,6 +67,10 @@ class Plugin::Instance
|
|||
klass.send(:define_method, "include_#{attr}?") { plugin.enabled? }
|
||||
end
|
||||
|
||||
def whitelist_staff_user_custom_field(field)
|
||||
User.register_plugin_staff_custom_field(field, self)
|
||||
end
|
||||
|
||||
# Extend a class but check that the plugin is enabled
|
||||
# for class methods use `add_class_method`
|
||||
def add_to_class(klass, attr, &block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue