mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: New plugin API to check if upload is used (#15545)
This commit introduces two new APIs for handling unused uploads, one can be used to exclude uploads in bulk when the data model allow and the other one excludes uploads one by one.
This commit is contained in:
@ -252,6 +252,14 @@ class Plugin::Instance
|
||||
Site.add_categories_callbacks(&block)
|
||||
end
|
||||
|
||||
def register_upload_unused(&block)
|
||||
Upload.add_unused_callback(&block)
|
||||
end
|
||||
|
||||
def register_upload_in_use(&block)
|
||||
Upload.add_in_use_callback(&block)
|
||||
end
|
||||
|
||||
def custom_avatar_column(column)
|
||||
reloadable_patch do |plugin|
|
||||
UserLookup.lookup_columns << column
|
||||
|
Reference in New Issue
Block a user