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:
Bianca Nenciu
2022-02-16 09:00:30 +02:00
committed by GitHub
parent add4b74e08
commit 5eaf214594
4 changed files with 104 additions and 7 deletions

View File

@ -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