mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
Refactor flag types for more customization
This commit is contained in:
parent
e600fb79b3
commit
838568cbc3
26 changed files with 253 additions and 82 deletions
|
@ -90,6 +90,15 @@ class Plugin::Instance
|
|||
end
|
||||
end
|
||||
|
||||
def replace_flags
|
||||
settings = ::FlagSettings.new
|
||||
yield settings
|
||||
|
||||
reloadable_patch do |plugin|
|
||||
::PostActionType.replace_flag_settings(settings) if plugin.enabled?
|
||||
end
|
||||
end
|
||||
|
||||
def whitelist_staff_user_custom_field(field)
|
||||
reloadable_patch do |plugin|
|
||||
::User.register_plugin_staff_custom_field(field, plugin) if plugin.enabled?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue