Wordpress plugin: a theme updater for GitHub hosted Wordpress themes
Installation & Use
1- Publish Theme to a public GitHub Repository
2- Update Your Theme's
Github Theme URI to your
style.css header, this will be where the plugin looks for updates. I also recommend using semantic versioning for the version number.
Theme Name: Example Theme URI: http://example.com/ Github Theme URI: https://github.com/username/repo Description: My Example Theme Author: person Version: v1.0.0
Push these changes back to the project
3- Create a new tag
$ git tag v1.0.0 $ git push origin v1.0.0
note, your tag numbers and theme version numbers should be in accord.
4- Download and install the plugin
The next time you push a new tag, it will be recognized by the plugin and will be notified in the wp-admin.
The flow of the plugin is:
1 - Get the Theme's Update URI
Code is a mashup of Wordpress source. I'm looking at:
2 - Get the github tags
Pull the tags trough the Repository Refs API.
3 - Notify Worpress of the Update
Publish the update details to the
response array in the
update_themes transient, similar to how Wordpress updates themes.