mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:38:20 +08:00
FEATURE: Allow complex post params from plugin (#8598)
This commit is contained in:

committed by
GitHub

parent
1e4a83cc2a
commit
6ec3d42b16
@ -250,9 +250,9 @@ class Plugin::Instance
|
||||
end
|
||||
|
||||
# Add a permitted_create_param to Post, respecting if the plugin is enabled
|
||||
def add_permitted_post_create_param(name)
|
||||
def add_permitted_post_create_param(name, type = :string)
|
||||
reloadable_patch do |plugin|
|
||||
::Post.plugin_permitted_create_params[name] = plugin
|
||||
::Post.plugin_permitted_create_params[name] = { plugin: plugin, type: type }
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user