Wordpres core-update theme renames theme folder name
I've got a theme that checks for a new version on GitHub. When it finds a new version it downloads it and install it. The problem is that it installs the theme with a different folder name than previous. Resulting errors.
I call the updater with hook pre_set_site_transient_update_themes
In it I check the GitHub api with: https://api.github.com/repos/my-name/my-repo/releases/latest
I set the update package
variable with https://api.github.com/repos/my-name/my-repo/zipball/0.1.0
Where 0.1.0
is the latest version.
So if I install a theme manually the theme root folder is called something like: my-theme
. Updating the theme downloads a new set of files with a different theme folder name. Something like my-theme-3d547d1
. Next update its again being renamed, something like my-theme-58fa412
.
How can I prevent this? Is this something on the GitHub side where I rename the target's zip file name or Something wordpress side, where it renames the zip after download and before install?
#in short#
Wordpress renames the theme folder when fetching theme update from GitHub, how to prevent this
Topic github git automatic-updates theme-development updates Wordpress
Category Web