mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Ability for plugins to whitelist custom fields for flags
You can now call `whitelist_flag_post_custom_field` from your plugins and those custom fields will be available on the flagged posts area of the admin section.
This commit is contained in:
@@ -109,6 +109,12 @@ class Plugin::Instance
|
||||
end
|
||||
end
|
||||
|
||||
def whitelist_flag_post_custom_field(field)
|
||||
reloadable_patch do |plugin|
|
||||
::FlagQuery.register_plugin_post_custom_field(field, plugin) # plugin.enabled? is checked at runtime
|
||||
end
|
||||
end
|
||||
|
||||
def whitelist_staff_user_custom_field(field)
|
||||
reloadable_patch do |plugin|
|
||||
::User.register_plugin_staff_custom_field(field, plugin) # plugin.enabled? is checked at runtime
|
||||
|
||||
Reference in New Issue
Block a user