Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My plugin allows for some custom templates to be installed into it by the user. Problem is, if someone deletes the plugin from WP in order to install a new version, all their custom files get deleted as well.

Is there a way to catch deletion and fire an alert warning the user of this, before they delete?

Oh and putting their templates into the DB is not an acceptable option.

share|improve this question
add comment

1 Answer 1

Consider using an external directory to store such dependencies for your scenario like WP_CONTENT_DIR.'/plugin-templates' (other then your real plugin folder) or smth. And allow users to remove it manually when they really want to uninstall.

I don't think you should delete plugins to update them... BUT I NEVER USED THE DEFAULT UPDATER (I disable it intentionally) so I don't even know how it works.

Regards.

share|improve this answer
    
Yeah I don't recommend users delete in order to install, but I already know from some of my beta users that some people will do exactly that, so I'm trying to prepare for the inevitable. :) Thanks for the suggestion, I may have to go that route. –  Jonathan van Clute Nov 2 '11 at 16:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.