WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to prevent folder under my plugin from being deleted/replace while update? (3 posts)

  1. takien
    Member
    Posted 1 year ago #

    I have plugin that allow user to write Custom CSS, and stored under my-plugin/themes/custom.css
    But whenever user update their plugin to newer version that customization would be replaced/deleted. how to keep that folder/files?
    I found that forcing user to save custom CSS under WordPress theme directory is not a good way, since user may change their WP theme.

    any solution for this? thank you.

  2. catacaustic
    Member
    Posted 1 year ago #

    Any folders that are under your plugins main root folder will be deledted when the update happens. That's just how it goes. The way that I've seen plugins get around this is by adding another folder in the /pluigns/ directory and storing files in there. That awy the custom files don't get deleted with the rest of the plugin when updates occur.

  3. takien
    Member
    Posted 1 year ago #

    great solution. thanks catacaustic :)

Topic Closed

This topic has been closed to new replies.

About this Topic