Add Plugin API to register a category custom field.

This commit is contained in:
Guo Xiang Tan 2017-08-17 15:59:31 +09:00
parent 43e2c91845
commit 2157079d09
1 changed files with 6 additions and 0 deletions

View File

@ -248,6 +248,12 @@ class Plugin::Instance
end
end
def register_category_custom_field_type(name, type)
reloadable_patch do |plugin|
Category.register_custom_field_type(name, type) if plugin.enabled?
end
end
def register_topic_custom_field_type(name, type)
reloadable_patch do |plugin|
::Topic.register_custom_field_type(name, type) if plugin.enabled?