[wp-hackers] flickr Short Code Questions
Otto
otto at ottodestruct.com
Wed Jun 25 13:35:14 GMT 2008
On Tue, Jun 24, 2008 at 8:31 PM, Jorge Peña <jorgepblank at gmail.com> wrote:
> Alexander: Thanks but I was referring to something like
> [flickr]37603554 at N00/2116110595/[/flickr]
> but I guess it's not possible.
It is, actually, you just have to use the Flickr API to get the URL of
the picture.
Here's the basic code you'd write.
function flickr_func($atts, $content = null) {
// $content contains the ID number
// do the flickr API stuff here to get the photo URL.. you might want
to cache this value somewhere
return "<img src='PHOTO_URL' />";
}
add_shortcode('flickr', 'flickr_func');
The "flickr API stuff" would be what you find here:
http://www.flickr.com/services/api/misc.urls.html
More information about the wp-hackers
mailing list