I have a client’s theme currently hosted on github. Instead of doing a git deploy or using a service like Beanstalk’s deployments. I will be pushing the same theme across many sites (79 to be exact) and want them to be able to update themselves just like a WP repo hosted theme. A good example is how the Genesis framework has it’s updates work. I’ve seen things where you have another plugin installed to do this, but i’m looking for a more minimalist solution (if there is anyway to keep this functionality within the theme itself)?
2 Answers
There’re a couple of libraries out there. One of the more well known is from Joey Kudish and hosted on GitHub itself.
Basically it does the following:
- utilizes the GitHub API
- Adds a callback to the
'pre_set_site_transient_update_plugins'
filter - Adds another callback to the
'plugins_api'
filter - finally utilizes the WP HTTP API and does a
wp_remote_get()
to the GitHub repo.
Oh, yes – close to have forgotten this – it adds a transient to avoid checking the remote repo on every request.