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:
Robin Ward
2018-08-09 10:49:14 -04:00
parent cc90ed3870
commit 5895507153
2 changed files with 36 additions and 1 deletions

View File

@@ -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