Private theme is not installing new version with correct dir name
-
I have a private theme that contains a .json and .zip, this works fine hooking into
pre_set_site_transient_update_themes
.However during the installation process it will download and unpack the zip into
wp-content/upgrade
with a random hash on the end of the filename, sotheme.zip
=>theme-kw342
.This is a problem as when it moves (and deletes the current theme)
theme-kw342.zip
intowp-content/themes
it doesn’t rename the folder totheme
, it keeps it astheme-kw342
which means my theme breaks.I have resorted to renaming the folder when it’s in
wp-content/upgrade
(by hooking intoupgrader_source_selection
) but it doesn’t seem right.Any ideas?
This is a gist of my code,
get_config
anddebug_log
are helper function I have created.https://gist.github.com/connorjburton/3f9db2abf888f2192c73
For reference, my theme.json:
{ "new_version": "0.1.38", "url": "http:\/\/urlhere.com\/updates.html", "package": "http:\/\/urlhere.com\/theme.zip" }
- The topic ‘Private theme is not installing new version with correct dir name’ is closed to new replies.