{"id":139,"date":"2025-05-02T23:17:02","date_gmt":"2025-05-02T23:17:02","guid":{"rendered":"https:\/\/niklouch.com\/blog\/?p=139"},"modified":"2025-05-10T18:49:36","modified_gmt":"2025-05-10T18:49:36","slug":"nlflickralbumrenderer-plugin","status":"publish","type":"post","link":"https:\/\/niklouch.com\/blog\/nlflickralbumrenderer-plugin\/","title":{"rendered":"NLFlickrAlbumRenderer Plugin"},"content":{"rendered":"\n<p>Having with <a href=\"https:\/\/wordpress.org\/\">WordPress<\/a> since about 2005, building sites, blogs, a few web applications, communities and really just enjoying it&#8217;s use as an extensible framework for rapid development. I&#8217;ve created my own themes, plugins and other extensions &#8211; but always kept them for myself, not out of any selfishness but they were &#8220;by me, for me&#8221; and I wasn&#8217;t sure they&#8217;d benefit anyone else. I have pared back my development against the WordPress framework recently, erring for a more &#8220;basic&#8221; site &#8211; simpler to maintain, as this isn&#8217;t a job, it&#8217;s just me doing it for me&#8230;<\/p>\n\n\n\n<p>However, recently I have spent a couple of days working on a plugin that suited my needs, but also may be of use to others &#8211; either as a curiosity on basic plugin development or integration with Flickr.  The NLFlickrAlbumRenderer does what it says on the tin: Renders a Flickr album &#8211; with a few niceties:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>3 rendering options: List, Grid or Masonry<\/li>\n\n\n\n<li>Integration with <a href=\"https:\/\/fslightbox.com\/\">FullScreenLightBox.js<\/a><\/li>\n\n\n\n<li>Caching of photoset data to reduce API calls<\/li>\n\n\n\n<li>Instantiated by a <a href=\"https:\/\/wordpress.com\/support\/wordpress-editor\/blocks\/shortcode-block\/\">shortcode<\/a><\/li>\n\n\n\n<li>API key and user Id administered within the blog admin<\/li>\n<\/ul>\n\n\n\n<p>The shortcode needed is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;NLFlickrAlbum photoset_id=\"{id}\" layout=\"{layout}\"]<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>{id} to be replaced with the photoset Id from Flickr<\/li>\n\n\n\n<li>{layout} to be replaced with either &#8220;list&#8221;, &#8220;grid&#8221; or &#8220;masonry&#8221;<\/li>\n<\/ul>\n\n\n\n<p>This will call the plugin to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect to the Flick API using the API key and user Id provided<\/li>\n\n\n\n<li>Get the photoset using the photoset_id provided<\/li>\n\n\n\n<li>Get the photos in the photoset<\/li>\n\n\n\n<li>Get the info for each photo<\/li>\n\n\n\n<li>Get the sizes for each photo<\/li>\n\n\n\n<li>Store the output of the combined API calls as a cached JSON file<\/li>\n\n\n\n<li>Check the cache<\/li>\n\n\n\n<li>Use the JSON data to render the photoset<\/li>\n<\/ul>\n\n\n\n<p>There&#8217;s not much to say about this &#8211; it&#8217;s not the best plugin ever, it basically does one thing and I am open to any suggestions that it could do it better.  But it works for me, and I&#8217;ve made it as generic as needed to feel comfortable sharing it.<\/p>\n\n\n\n<p>Code is available at: <a href=\"https:\/\/github.com\/NLouch\/NLFlickrAlbumRenderer\/\">Github.com\/NLouch\/NLFlickrAlbumRenderer<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have spent a couple of days working on a plugin that may be of use to others &#8211; rendering a Flickr album &#8211; with a few niceties<\/p>\n","protected":false},"author":1,"featured_media":141,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9,42,6,12,10,7,11,8],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-api","tag-code","tag-flickr","tag-github","tag-json","tag-php","tag-plugin","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":2,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/posts\/139\/revisions\/145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/media\/141"}],"wp:attachment":[{"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/niklouch.com\/blog\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}