[theme-reviewers] How do the theme updates work?

Otto otto at ottodestruct.com
Sat Oct 19 02:53:57 UTC 2013


On Fri, Oct 18, 2013 at 9:02 PM, Edward Caissie
<edward.caissie at gmail.com> wrote:
> @Rohit - Writing to your original question (although typically Child-Themes
> are the more correct answer), only the files included with the theme package
> will be used with a theme update. This is important to keep in mind if you
> remove a file from your theme as it will remain in any installation of your
> theme prior to that change.
>
> This is also essentially how page templates can survive a theme update.


I'm not 100% certain, but I'm pretty sure that's wrong.

Updating a theme or a plugin deletes the existing theme or plugin
first, by removing the whole directory. Nothing in the theme or plugin
directory survives an update.

You can check the code to be sure. It's the Theme_Upgrader class in
class-wp-upgrader.php. The upgrade() function calls the run() function
with the "clear_destination" flag set to true, which should mean that
it deletes the theme directory before installing the new package.

-Otto


More information about the theme-reviewers mailing list