{"id":45464,"date":"2014-08-24T17:00:02","date_gmt":"2014-08-24T17:00:02","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/image-autorefresh-shortcode\/"},"modified":"2015-02-04T11:33:28","modified_gmt":"2015-02-04T11:33:28","slug":"image-autorefresh-shortcode","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/image-autorefresh-shortcode\/","author":13254025,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.4","stable_tag":"1.4","tested":"4.1.42","requires":"2.6","requires_php":"","requires_plugins":"","header_name":"Image autorefresh shortcode","header_author":"Klaske van Vuurden","header_description":"","assets_banners_color":"","last_updated":"2015-02-04 11:33:28","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/klasske\/wp_image_autorefresh","header_author_uri":"https:\/\/github.com\/klasske\/","rating":4.8,"author_block_rating":0,"active_installs":100,"downloads":2033,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"4"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1","1.2","1.3","1.4"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[35918,133,5827,21142,80],"plugin_category":[43,50,59],"plugin_contributors":[87442],"plugin_business_model":[],"class_list":["post-45464","plugin","type-plugin","status-closed","hentry","plugin_tags-autorefresh","plugin_tags-image","plugin_tags-refresh","plugin_tags-reload","plugin_tags-shortcode","plugin_category-customization","plugin_category-media","plugin_category-utilities-and-tools","plugin_contributors-kvu022","plugin_committers-kvu022"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/image-autorefresh-shortcode.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>More info at <a href=\"https:\/\/github.com\/klasske\/wp_image_autorefresh\">the GitHub repository<\/a><\/p>\n\n<p><strong>Image autorefresh shortcode<\/strong><\/p>\n\n<p>Image autorefresh shortcode is a small shortcode plugin for <a href=\"http:\/\/wordpress.org\">WordPress<\/a> that allows images in your post that reload on a regular interval<\/p>\n\n<p><em>How to use the plugin<\/em><\/p>\n\n<p>After installing and activating of the plugin in your WordPress page, you can add the following shortcode anywhere in your post or page text:<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\"]\n<\/code><\/pre>\n\n<p>This will create a left aligned <code>&lt;div&gt;<\/code> containing your image. It will refresh every 60 seconds.<\/p>\n\n<p>You can specify a different refresh time<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" refresh_time=10]\n<\/code><\/pre>\n\n<p>Add a caption<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" caption=\"Your caption\"]\n<\/code><\/pre>\n\n<p>Or specify a different alignment (<code>left<\/code>, <code>right<\/code>, <code>center<\/code> or <code>none<\/code>)<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" align=\"center\"]\n<\/code><\/pre>\n\n<p>Add width and height in pixels<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" width=320 height=240]\n<\/code><\/pre>\n\n<p>Add classes to the image<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" class=\"your_custom_class\"]\n<\/code><\/pre>\n\n<p>Add a custom query string to the image<\/p>\n\n<pre><code>[image-autorefresh src=\"image-url\" query_string=\"usr=test_user&amp;password=some_password\"]\n<\/code><\/pre>\n\n<p><em>Examples<\/em><\/p>\n\n<p>The shortcode<\/p>\n\n<pre><code>[image-autorefresh\n    src=\"http:\/\/weather.cs.uit.no\/wcam0_snapshots\/wcam0_latest_small.jpg\"\n    refresh_time=120\n    caption=\"A view from Troms\u00f8 university\"\n    align=\"center\"]\n<\/code><\/pre>\n\n<p>will generate the following code inside your post:<\/p>\n\n<pre><code>&lt;script&gt;\n    setInterval(function()\n    {\n        d = new Date();\n        image = jQuery('img#image_autorefresh_timb8XZCWL');\n        image.attr(\"src\", image.data(\"src\") + \"?\" + d.getTime());\n    }, 120000);\n&lt;\/script&gt;\n\n&lt;div class=\"wp-caption aligncenter\"&gt;\n    &lt;img src=\"http:\/\/weather.cs.uit.no\/wcam0_snapshots\/wcam0_latest_small.jpg\"\n         data-src=\"http:\/\/weather.cs.uit.no\/wcam0_snapshots\/wcam0_latest_small.jpg\"\n         class=\"image_autorefresh\"\n         id=\"image_autorefresh_timb8XZCWL\"\n         data-refresh=\"120\"\n         style=\"width: 640px;\"&gt;\n    &lt;p class=\"wp-caption-text\"&gt;A view from Troms&amp;oslash; university&lt;\/p&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>Which will automatically refresh the live view from Troms&oslash; every 120 seconds<\/p>\n\n<p><em>Multiple images<\/em><\/p>\n\n<p>The shortcode allows for multiple images on one page with different refresh rates.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Unpack \\\"wp_image_autorefresh.zip\\\" to the \\\"\/wp-content\/plugins\/\\\" directory.<\/li>\n<li>Activate the plugin through the \\\"Plugins\\\" menu in WordPress.<\/li>\n<li>Place shortcode  in your post.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Can I add multiple images in one post?<\/dt>\n<dd><p>Yes, you can sue the shortcode multiple times and set different refresh intervals for each.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4<\/h4>\n\n<ul>\n<li>Added the 'alt' attribute to comply with WCAG<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Added the parameter <code>query_string<\/code> to add any query parameters necessary to load the image<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added height, width and class parameters.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Images are only reloaded when they are in a window which currently has focus.<\/li>\n<\/ul>\n\n<h4>1<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Lightweight shortcode plugin created specifically for reloading images that are refreshed on a regular basis (for example from live camera feeds)","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/45464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=45464"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kvu022"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=45464"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=45464"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=45464"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=45464"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=45464"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=45464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}