Home › Forums › Newsletter Plugin Support › stop deleting my theme
- This topic has 7 replies, 4 voices, and was last updated 5 years, 6 months ago by Jenny Scott.
-
AuthorPosts
-
March 21, 2019 at 3:12 pm #161531Jenny ScottParticipant
Annoyingly, it seems that every time the plugin (specifically the automated) is updated, my theme is deleted. I have backups of course, but it means my newsletter doesn’t get sent and I have to manually upload and reset the theme for the newsletter to go out.
How can this be prevented in the future?
March 21, 2019 at 8:21 pm #161584StefanoKeymasterHi, it’s not the plugin deleting your theme is wordpress deleting a plugin folder before updating it. Custom theme should be placed in a different folder, see the themes documentation in this site.
Thank you, Stefano.
March 22, 2019 at 2:56 pm #161707Jenny ScottParticipantHi,
I read the documentation and don’t quite understand what I’m doing wrong. I put my theme in a new directory here:
\wp-content\plugins\newsletter-automated\themes\mytheme\
And it’s this that gets deleted. Should this go in the main theme folder or somewhere else?
March 26, 2019 at 5:27 pm #162626darlie KwokParticipantI’m facing the same problem. My custom theme for automatic email is deleted every time when I update the plugin. Is there a way to avoid this? Where should I put my theme?
March 30, 2019 at 12:28 am #163388Michael BuschParticipantHi Jenny
This is the crucial part from the themes documentation:
Just to explain what this is, I’ll use an example based on the ‘Newsletters’ Module. When Newsletter looks for themes for ‘Newsletters’ Module, it first searches themes inside the natural theme folder, wp-content/plugins/newsletter/emails/themes. Then it scans a second folder at wp-content/extensions/newsletter/emails/themes. The folder wp-content/extensions/newsletter is a parallel version of the original plugin folder, and Newsletter treats both folders as if they were only one folder, by merging the contents of both folders together.
Basically you need to create a folder wp-content/extensions/newsletter/emails/themes and put your theme there…
The reason, as Stefano mentioned, is that WordPress Updates work like this: The complete Plugin folder is deleted and replaced with the content of the updated plugin. This is general WordPress behaviour and not specific to the newsletter plugin. Any plugin that saves data in a subfolder of the plugin folder will face the same problem.
Mike
March 30, 2019 at 11:25 am #163442Jenny ScottParticipantI think I might be missing something here – I still don’t get it. If I put my theme ANYWHERE in the plugin folder, when that plugin is updated the theme will be deleted whenever WP updates that plugin.
Surely it would be best if the theme could be placed in the /child-theme/ folder somewhere so that it’s never deleted by WP?
March 30, 2019 at 2:18 pm #163455Michael BuschParticipantHi Jenny
Yes you are missing something here: wp-content/extensions/newsletter/ is a folder that is NOT in the plugin’s folder… The plugin is placed below /wp-content/plugins and not extensions…
So any theme that is saved under extensions will not be deleted when the plugin is updated…Mike
April 1, 2019 at 2:32 pm #163899Jenny ScottParticipantHi – thanks for that Michael. I guess I the /extensions/ directory threw me. (It’s been one of those weeks!)
It appears to be working fine now 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.