[wp-hackers] api.wordpress.org/themes ?
Joseph Scott
joseph at randomnetworks.com
Tue Jan 13 21:52:22 GMT 2009
On Mon, Jan 12, 2009 at 12:13 AM, Jason DeVelvis <sales at emailappeal.com> wrote:
> I'm trying to code a themes installer plugin, similar to the plugin
> installer in the core (I know, I know, it'll probably be in 2.8, but I want
> it now...) and I've got it to do everything except find the proper theme
> .zip file.
>
> The API returns a download URL like
> http://downloads.wordpress.org/theme/openair.zip which returns a 404... The
> actual extend download URL for openair is
> http://wordpress.org/extend/themes/download/openair.1.1.7.zip
>
> Any ideas why the API download URLs are invalid? Did I jump into the API too
> early :) Could it be easily fixed so my plugin works? Or is there something
> else going on in my code if the API is returning the wrong d/l links?
Exactly what URL did you use for the API? I don't get a response that
looks anything like what you indicated.
There's code in -trunk that checks for theme updates. To try and keep
things as close to your example as possible I installed OpenAir 1.1.7
and edited the style.css to make it version 1.1.0 so that it would
trigger an updated theme response. A current response looks like:
a:1:{s:7:"openair";a:3:{s:11:"new_version";s:5:"1.1.7";s:3:"url";s:42:"http://wordpress.org/extend/themes/openair";s:7:"package";s:61:"http://wordpress.org/extend/themes/download/openair.1.1.7.zip";}}
> Note, that api info is obtained with this line of code:
> $api = themes_api('theme_information', array('slug' => $theme, 'fields' =>
> array('sections' => false) ) ); //Save on a bit of bandwidth.
>
> (where $theme = the slug I retrieved earlier in the process, which is
> 'openair')
>
> Coincidentally, there is no version # passed with the api call either. Could
> be the same problem?
--
Joseph Scott
joseph at randomnetworks.com
http://joseph.randomnetworks.com/
More information about the wp-hackers
mailing list