We have a setup where bloggers can and will have their theme changed. Is it possible to migrate the existing header image to the new theme ? I know how to override the header image with the add_filter, also know how to get the current header image. The issue here is to keep the header image when changing the theme. Is that possible ?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
Here comes the plugins to rescue, move that code into a plugin and activate. That'll not change header image upon every theme change. E.g -
save it as |
|||||||||
|
|
The header image is set per …
… a wrapper for …
So you can hook into …
… take the first parameter, which is an array of all theme mods, and save the value of the key Then filter |
|||||||||
|
|
We did a small mu-plugin that solved our issue. Here is the code
|
|||
|
|