Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

the question is simple :) I am making a theme that i will use in lots of sites. So, i don't want to go all the site and ftp the files every time i fix a bug or do a theme upgrade.

Is there any way i can make a update system like the plugins hosted in wordpress plugin directory.

Looking forward to your answer. Thanks!

Solved:

Thanks Chip Bennett for his excellent link. The update library for themes is now available in that site. You can find it here: http://w-shadow.com/blog/2011/06/02/automatic-updates-for-commercial-themes/

Always consider donation if you see some excellent work that made available for free.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

You can also hook into the core update routine. (I'm looking for tutorial links, but my Google-fu is failing me this morning.)

EDIT:

See if this tutorial helps. It explains how to implement automatic upgrades for private/commercial (i.e. non-repository-hosted) Plugins.

share|improve this answer
1  
I think it is pre_set_site_transient_update_plugins –  Wyck May 1 '11 at 15:27
    
Thanks! I will let you know as soon as i try it :) –  Sisir May 2 '11 at 7:56
    
Thanks! I go through you link and the plugin codes did not worked but i request the guy for modifying the library for themes couple of days later he made one! And now its working great! I will put the link in my question. Thanks!! –  Sisir Jun 8 '11 at 17:01
add comment

An interest question! In fact, I think you should make a service to check update! Such as yourdomain.comn/api/update-check! Then this can return XML or JSON or some useful information related to update such as version, the url of update file (updated file should be a zip file)!

In your theme you can have:

    <?php define('OWN_THEME_VERSION', '1.1');

So, when you detected an update from above url(yourdomain.comn/api/update-check), assume it returns JSO data as following: {"version":"1.2","file":"theme.zip"}

You compare version to check for new update! Then switch to default theme with this function http://codex.wordpress.org/Function_Reference/switch_theme (in order when users access the site, they see a worlking site)! Next, your code can use curl or even file_get_contents to download zip file (theme.zip in this case)! Next, you delete all file of in your theme folder, then extrat zip file and copy its content into theme folder! I think this way it should work!

You may want to take a look on what WordPress did! I found it's in file wp-admin/includes/update-core.php, line 288, function update_core

share|improve this answer
2  
Basically this but instead of using curl or file_get use the WordPress HTTP API, codex.wordpress.org/HTTP_API –  Wyck May 1 '11 at 12:35
    
Cool Wyck, I did't know that ;)! –  kureikain May 1 '11 at 12:39
    
Thank you guys! Very interesting info. I will let you know as soon as i try it :) –  Sisir May 2 '11 at 7:55
    
finally got some time to start reserch on this! For the current version of the theme i can use this function codex.wordpress.org/Function_Reference/get_theme_data . I will start to work with the approach you indicated. –  Sisir May 29 '11 at 20:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.