[wp-hackers] CDN Integration?

Sabin Iacob iacobs at m0n5t3r.info
Wed Feb 4 08:20:37 GMT 2009


Mike Schinkel wrote:
> Yes, thanks. 
>
> I've actually just completed the work on a (mostly generic) plugin for (Limelight) CDN integration and applied it to the theme of the site we are building. Unfortunately the NextGen Gallery which we are using has several hard-coded references to get_option('site_url') which means I have to modify his plug in order to use it and I want to avoid modifying other's code if possible.  This is an example of why it would be nice to have a better vetted image management api, but I digress.
>
> It occurs to me that what would be helpful would be to add the following to get_bloginfo():
>
>    get_bloginfo('images_url')
>    get_bloginfo('videos_url')
>    get_bloginfo('css_url')
>    get_bloginfo('js_url')
>
> And maybe more. These could then default to the theme + the file (i.e. get_bloginfo('template_url')+'/images', etc.) and be stated it's a best practice to use these in themes and plugins. 
>
> If I had these and there were used correctly I could write a CDN Integration plugin that would be (almost?) seemless.
>   

get_bloginfo calls get_option behind the scenes, so they are not hard to
add, but to get others to actually use this convention may be difficult ;)

also, for options you want to modify on the fly, I remember from the
days when I actually had time to write wordpress plugins about an
undocumented series filters looking like "option_<option_name>" (e.g.
option_html_type,  built dynamically), from a quick look at the source
in trunk, that feature is still there :o)



More information about the wp-hackers mailing list