]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/remove.pm
more generic interface
[ikiwiki.git] / IkiWiki / Plugin / remove.pm
index 5e5b83349b63dd6b5790023dcbd0b302bffa8c8d..e6f7e1dbd1c530e47a1accccdbcd0232723d52b1 100644 (file)
@@ -120,8 +120,15 @@ sub removal_confirm ($$@) {
                
        # Special case for unsaved attachments.
        @pages=grep {
-               ! (IkiWiki::Plugin::attachment->can("remove_held_attachment") &&
-                  IkiWiki::Plugin::attachment::remove_held_attachment($_))
+               if (IkiWiki::Plugin::attachment->can("is_held_attachment")) {
+                       my $f=IkiWiki::Plugin::attachment::is_held_attachment($_);
+                       if (defined $f) {
+                               require IkiWiki::Render;
+                               IkiWiki::prune($f);
+                               0;
+                       }
+               }
+               1;
        } @pages;
        return unless @pages;