mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Add category custom field preloading to CategoryList (#23969)
This commit also introduced a plugin API for preloading category custom fields.
This commit is contained in:
@ -290,6 +290,13 @@ class Plugin::Instance
|
||||
Upload.add_in_use_callback(&block)
|
||||
end
|
||||
|
||||
# Registers a category custom field to be loaded when rendering a category list
|
||||
# Example usage:
|
||||
# register_category_list_preloaded_category_custom_fields("custom_field")
|
||||
def register_category_list_preloaded_category_custom_fields(field)
|
||||
CategoryList.preloaded_category_custom_fields << field
|
||||
end
|
||||
|
||||
def custom_avatar_column(column)
|
||||
reloadable_patch do |plugin|
|
||||
UserLookup.lookup_columns << column
|
||||
|
Reference in New Issue
Block a user