mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: Allow complex post params from plugin (#8598)
This commit is contained in:
parent
1e4a83cc2a
commit
6ec3d42b16
3 changed files with 69 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue