Hi Surbma,
Actually, the CSS isn’t deleted, it’s still there in the revisions. You can see Revisions on the right side of the edit CSS page, like in this screenshot:
http://d.pr/i/4gSr
The latest revision will be the CSS that you had saved for that theme before you siwtched to another theme.
Thread Starter
Surbma
(@surbma)
Actually the CSS is deleted. The revision is there only if it is not disabled. For me, revisions are disabled. It is intentionally disabled.
So all the CSS are deleted and lost if I switch theme, which is a very big issue.
Please fix it to save the CSS for every case! Thank you!
The CSS editor uses Custom Post Types, which are saved as revisions. If you switch theme, the current CSS is saved as a revision so that you can have a clean slate for the other theme. That is how the module works and changing that behaviour would require a complete rewrite of how the module functions. If you have revisions disabled, I can see why this would cause a problem for you, obviously. In your case then, I suggest trying a different Custom CSS plugin, or alternatively, you can create a Child theme for your current theme.
Thread Starter
Surbma
(@surbma)
Is it possible to put a warning message if somebody clicks on the activate (new) theme AND post revisions are disabled, so the user will know, that every custom css will be removed after switching theme?
This will be a good solution, so if somebody has disabled revisions he or she doesn’t lose everything because of a theme switch.
I have a Multisite network with hundreds of websites and child theme solution is not working to customize the same theme as it needs hundreds of child themes as well. So Jetpack’s Custom CSS solution is the best choice for me.
Thank you!
Hi! For the record, I created a Trac ticket for this issue here:
http://plugins.trac.wordpress.org/ticket/1985#ticket
Thread Starter
Surbma
(@surbma)
Thank you Richard for the care! 🙂
I don’t know, if it needs a separate thread or I can report it here, but unfortunately Jetpack Custom CSS revision is not working if revision is set to 1. If I change a theme, than the 1 enabled revision will be empty also. Tested on different sites with the same results. It only works with minimum 2 revisions.
I think it should save the previous css if only 1 revision is set. I have a really big Multisite, so it is important to keep the database on the minimum.
If it needs a new thread, I will open, but maybe it is still connected with this topic.