<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>CodeHooligans</title>
	
	<link>http://www.codehooligans.com</link>
	<description>I'm the Devil in the code!</description>
	<lastBuildDate>Wed, 20 Jan 2010 00:00:00 PST</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/codehooligans" /><feedburner:info uri="codehooligans" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><image><link>http://creativecommons.org/licenses/by-sa/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>codehooligans</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Links for 2010-01-19 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/ZEsRqf3X4kY/codehooligans</link><pubDate>Wed, 20 Jan 2010 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2010-01-19</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://apod.nasa.gov/apod/archivepix.html"&gt;Astronomy Picture of the Day Archive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.google.com/help/maps/favoriteplaces/business/barcode.html"&gt;QR Code - Google Favorite Places&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/ZEsRqf3X4kY" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2010-01-19</feedburner:origLink></item><item><title>Links for 2010-01-18 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/X6yMQ-8T63I/codehooligans</link><pubDate>Tue, 19 Jan 2010 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2010-01-18</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.phonegap.com/"&gt;PhoneGap       | Cross platform mobile framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/X6yMQ-8T63I" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2010-01-18</feedburner:origLink></item><item><title>Links for 2010-01-15 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/0fv_EBglnxY/codehooligans</link><pubDate>Sat, 16 Jan 2010 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2010-01-15</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://framework.zend.com/download/webservices"&gt;Zend Framework: Downloads&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/apis/youtube/2.0/developers_guide_protocol_clientlogin.html"&gt;Developer's Guide: Data API Protocol &amp;ndash; ClientLogin for Installed Applications - YouTube APIs and Tools - Google Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/apis/accounts/docs/GettingStarted.html"&gt;Getting Started with Account Authorization - Accounts APIs - Google Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/0fv_EBglnxY" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2010-01-15</feedburner:origLink></item><item><title>Links for 2010-01-08 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/0C5VsCZdcHU/codehooligans</link><pubDate>Sat, 09 Jan 2010 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2010-01-08</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://twitapi.com/explore/"&gt;Welcome  | Twitter API Explorer - twitapi.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/0C5VsCZdcHU" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2010-01-08</feedburner:origLink></item><item><title>Links for 2010-01-05 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/F9MPEknRFNo/codehooligans</link><pubDate>Wed, 06 Jan 2010 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2010-01-05</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://forge.mysql.com/wiki/Eventum/"&gt;Eventum/ - MySQL Forge Wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems"&gt;Comparison of issue tracking systems - Wikipedia, the free encyclopedia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/F9MPEknRFNo" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2010-01-05</feedburner:origLink></item><item><title>Links for 2009-12-30 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/MyL3RBrHDVY/codehooligans</link><pubDate>Thu, 31 Dec 2009 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2009-12-30</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.ddg.com/?p=24"&gt;Discern, Design, Generate &amp;rsaquo; Network Reachability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lost-in-code.com/programming/jquery-auto-iframe-height/"&gt;jQuery : Auto iFrame Height&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/MyL3RBrHDVY" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2009-12-30</feedburner:origLink></item><item><title>Links for 2009-12-29 [del.icio.us]</title><link>http://feedproxy.google.com/~r/codehooligans/~3/VGLbfOz-1ng/codehooligans</link><pubDate>Wed, 30 Dec 2009 00:00:00 PST</pubDate><guid isPermaLink="false">http://del.icio.us/codehooligans#2009-12-29</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.devx.com/wireless/Article/43502"&gt;iPhone Bluetooth Programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.devx.com/wireless/Article/43551"&gt;iPhone Network Programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.opencart.com/"&gt;OpenCart - Open Source Shopping Cart Solution&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/codehooligans/~4/VGLbfOz-1ng" height="1" width="1"/&gt;</description><feedburner:origLink>http://del.icio.us/codehooligans#2009-12-29</feedburner:origLink></item><item>
		<title>Disable WordPress Plugins update indicator for inactive plugins</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/GgUEoKYGIhE/</link>
		<comments>http://www.codehooligans.com/2009/08/30/disable-wordpress-plugins-update-indicator-for-inactive-plugins/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 01:13:01 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=463</guid>
		<description><![CDATA[<p>I have to really tip my hat to the guys that work hard on the core WordPress code at Automatic. In the last 12 months they taken the system to new heights with a complete redo of the admin interface.&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I have to really tip my hat to the guys that work hard on the core WordPress code at Automatic. In the last 12 months they taken the system to new heights with a complete redo of the admin interface. Adding many features to extend the core so that developers like myself can extend things even further. </p>
<p>Take for example the nice little number displayed on the Plugins menu item when some of your installed plugins are out of date. What a nice little feature. There is also an update display on the actual Plugins page the little yellow-ish box below a plugin row to indicate there is an update and the user needs to take action. From a usability stand point I think this sort of forward thinking is the reason I keep hacking in WordPress instead of other CMS-type systems like Drupal, Joomla, eZ Publish, etc. </p>
<p><a href="http://www.codehooligans.com/wp-content/uploads/wp-plugin-list-update-indicator.png" rel="lightbox[463]"><img src="http://www.codehooligans.com/wp-content/uploads/wp-plugin-list-update-indicator-300x73.png" alt="wp-plugin-list-update-indicator" title="wp-plugin-list-update-indicator" width="300" height="73" class="aligncenter size-medium wp-image-481" /></a></p>
<p><a href="http://www.codehooligans.com/wp-content/uploads/wp-plugin-nav-update-indicator.png" rel="lightbox[463]"><img src="http://www.codehooligans.com/wp-content/uploads/wp-plugin-nav-update-indicator.png" alt="WordPress Nav Update Indicator" title="WordPress Nav Update Indicator" width="143" height="31" class="size-full wp-image-478" /></a></p>
<p>But I do have a major annoyance with this &#8216;feature&#8217;. Like many other WordPress users I have man plugins installed. At any given time I will have a third of the plugins disabled maybe because I was testing things or maybe I deactivated the plugin but didn&#8217;t want to  uninstall it. My annoyance is that the plugin update indicators work on all plugins even those you don&#8217;t have active. Not good. Worse on the client sites I support I really don&#8217;t want the client to need to worry about updating inactive plugins. </p>
<p>Sure I know there are at least half a dozen plugins that will completely turn off the plugin and WordPress core update nag indicators. But I really don&#8217;t want that. I just don&#8217;t want to see update nag on those plugins I&#8217;m not currently using. </p>
<p>So I did some research on this lazy Sunday afternoon and figured out how to hide the update indicator on those inactive plugins. The code below will hide these inactive plugin from the update counter. When the plugin is re-activated the plugin update indicator will once again show in the sidebar menu and on the plugins listing. </p>
<h2>The Code</h2>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> update_active_plugins<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; The $value array passed in contains the list of plugins with time <br />
&nbsp; &nbsp; marks when the last time the groups was checked for version match<br />
&nbsp; &nbsp; The $value-&gt;reponse node contains an array of the items that are <br />
&nbsp; &nbsp; out of date. This response node is use by the 'Plugins' menu<br />
&nbsp; &nbsp; for example to indicate there are updates. Also on the actual <br />
&nbsp; &nbsp; plugins listing to provide the yellow box below a given plugin <br />
&nbsp; &nbsp; to indicate action is needed by the user. <br />
&nbsp; &nbsp; */</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Get the list cut current active plugins</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$active_plugins</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'active_plugins'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$active_plugins</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// &nbsp;Here we start to compare the $value-&gt;response </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//&nbsp; items checking each against the active plugins list. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$plugin_idx</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$plugin_item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// If the response item is not an active plugin then remove it. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// This will prevent WordPress from indicating the plugin needs update actions. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$plugin_idx</span><span style="color: #339933;">,</span> <span style="color: #000088;">$active_plugins</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$plugin_idx</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// If no active plugins then ignore the inactive out of date ones. </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$plugin_idx</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$plugin_item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'transient_update_plugins'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'update_active_plugins'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Hook for 2.8.x</span><br />
<span style="color: #666666; font-style: italic;">//add_filter( 'option_update_plugins', 'update_active_plugins');&nbsp; &nbsp; // Hook for 2.7.x</span></div></td></tr></tbody></table></div>
<p>A note on the &#8216;add_filter&#8217; lines just above. Seems there are two different hooks depending your the WordPress version. If you are running version 2.8.x or newer you should be safe to use the first add_filter line. If however you are still using 2.7.x then comment out the first add_filter an use the second one. </p>
<h2>Installation</h2>
<p>I really don&#8217;t plan to turn this into an official plugin for WordPress. So the simplest method of installation is to add it to your theme&#8217;s functions.php file. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=GgUEoKYGIhE:vBw34HsZ7iw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=GgUEoKYGIhE:vBw34HsZ7iw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=GgUEoKYGIhE:vBw34HsZ7iw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=GgUEoKYGIhE:vBw34HsZ7iw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=GgUEoKYGIhE:vBw34HsZ7iw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=GgUEoKYGIhE:vBw34HsZ7iw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=GgUEoKYGIhE:vBw34HsZ7iw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=GgUEoKYGIhE:vBw34HsZ7iw:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/GgUEoKYGIhE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/08/30/disable-wordpress-plugins-update-indicator-for-inactive-plugins/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/08/30/disable-wordpress-plugins-update-indicator-for-inactive-plugins/</feedburner:origLink></item>
		<item>
		<title>Media Tags 2.2 plugin for WordPress Released</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/niaCFo3dasU/</link>
		<comments>http://www.codehooligans.com/2009/08/17/media-tags-2-2-plugin-for-wordpress-released/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 18:32:26 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[media-tags]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=443</guid>
		<description><![CDATA[<p>Over this past week I added quite a few features to the famous Media Tags plugin for WordPress. The list below details many of these new features</p>
<ol>
<li>Added a new tab to the Media Upload popup box. Anyone familiar with WordPress&#8230;</li></ol>]]></description>
			<content:encoded><![CDATA[<p>Over this past week I added quite a few features to the famous Media Tags plugin for WordPress. The list below details many of these new features</p>
<ol>
<li>Added a new tab to the Media Upload popup box. Anyone familiar with WordPress Post or Page entry is familiar with the popup provided to upload images and other media files. In this popup if you wanted to search for items using the handy Media Tags it was not possible. Now the user is provided with a new Tab labelled &#8216;Media Tags&#8217;. When the tab is clicked the user is presented with a listing of all Media Tags used on the site. Along with the Media Tag name there is a use could in the far right of the listing. This count if greater than zero is a link and will filter the Media Library (another Tab) listing for items from that Media Tags group.
<p>Below is a screenshot of the new popup tab. <div id="attachment_445" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.codehooligans.com/wp-content/uploads/popup-tab-media-tags.png" rel="lightbox[443]"><img src="http://www.codehooligans.com/wp-content/uploads/popup-tab-media-tags-300x107.png" alt="Media-Tags New Upload popup tab" title="Media-Tags New Upload popup tab" width="300" height="107" class="size-medium wp-image-445" /></a><p class="wp-caption-text">Media-Tags New Upload popup tab</p></div></li>
<li>More control over the permalink prefix. The Media Tags plugin works with the WordPress Permalink rewrite system to provide &#8216;pretty&#8217; URLs for the archive. For example if you have some media loaded and tagged on your site for say &#8216;Texas&#8217;. The you can display these items in an archive type listing by using the URL http://www.mysite.com/media-tags/texas/ This format should be familiar to most users of WordPress since Categories and Tags or handled in much the same way. This feature was added in Media Tags version 2.0 and has received much acclaim from the users. The problem is the prefix &#8216;/media-tags/&#8217; was hard-coded into the plugin. I have a few users request a way to alter this prefix. Other than suggesting they edit the config file for the plugin there was not a good solution.
<p>So I starting thinking I would just build my own admin page where the user can set this permalink prefix. But I hated having to build a new admin page just for the one setting. Well over the weekend I found the solution of solutions. Why not just add my own field to the WordPress Settings -> Permalink page. This turned out to be quite easy using the new <a href="http://codex.wordpress.org/Settings_API">Settings API</a> introduced into WordPress 2.7. </p>
<p>Below is a screenshot of the new Media Tags Permalink option. The new field just below the standard Category and Tags fields. <div id="attachment_449" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.codehooligans.com/wp-content/uploads/permalink-slug-prefix.png" rel="lightbox[443]"><img src="http://www.codehooligans.com/wp-content/uploads/permalink-slug-prefix-300x82.png" alt="Media-Tag Permalink Slug Prefix" title="Media-Tag Permalink Slug Prefix" width="300" height="82" class="size-medium wp-image-449" /></a><p class="wp-caption-text">Media-Tag Permalink Slug Prefix</p></div></li>
<li>
<p>Playing nice with other plugins. I&#8217;ve used the Google Sitemap XML plugin for quite some time and generally install it by default onto any client site I&#8217;ve worked on. This is one of those plus plus plugins that can only help your site. Recently I had to figure out a way to include non-WordPress pages into the XML sitemap output. This is actually very easy to do as the plugin authors have provide a nice hook to allow this.</p>
<p>So my next enhancement to the Media-Tags plugin was to include the Media Tag archives into the Google Sitemaps XML output. This feature is quite powerful since it just adds juice to Google content harvesting. Not wanting to hard-coded this feature into the plugin I ended up building that admin interface I mentioned in the previous point. There is only one option on the page (more to come soon). A simple Yes/No box to include/exclude the Media Tags archive from the Sitemap XML output. I assume most people will wan this but also know there is always the possibility some may now.</p>
<p>Below is a screenshot of the new Media-Tag admin interface. Look for this under the standard WordPress Settings section.  <div id="attachment_454" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.codehooligans.com/wp-content/uploads/media-tags-admin-page.png" rel="lightbox[443]"><img src="http://www.codehooligans.com/wp-content/uploads/media-tags-admin-page-300x80.png" alt="Media-Tags Admin Page" title="Media-Tags Admin Page" width="300" height="80" class="size-medium wp-image-454" /></a><p class="wp-caption-text">Media-Tags Admin Page</p></div></p>
</li>
<li>Along with the above mentioned new features I also cleaned up some code related issues. Most of these are under the covers cosmetic items and not related to any screen changes.</li>
</ol>
<h2>Media Tags Future Enhancements</h2>
<p>Still on my list of features to add in some upcoming release is Media-Tags Cloud. This is still one of the most requested options for the sidebar. Still working on that code. Trying to follow some of the code written for the built-in WordPress Tags. pretty ugly stuff. Has to be a better way. </p>
<p>Other than the Media Tags Cloud I don&#8217;t have any big changes planned for the plugin. Then again the three features mentioned in this post were not planned at all. Just something that hit me on Friday that I started working toward. </p>
<p>So if there is a feature you just think would make the Media-Tags plugin rock for your blog please consider leaving a comment below. </p>
<h2>Donations</h2>
<p>If you enjoy using the <a href="http://wordpress.org/extend/plugins/media-tags/">Media Tags plugin</a> or any of my other <a href="http://wordpress.org/extend/plugins/profile/pmenard">WordPress plugins</a>, please consider making a <a href="http://www.codehooligans.com/donations/">donation</a> to show your support. Anything is appreciated. Thanks. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=niaCFo3dasU:MKchPUv0x-Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=niaCFo3dasU:MKchPUv0x-Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=niaCFo3dasU:MKchPUv0x-Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=niaCFo3dasU:MKchPUv0x-Q:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=niaCFo3dasU:MKchPUv0x-Q:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=niaCFo3dasU:MKchPUv0x-Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=niaCFo3dasU:MKchPUv0x-Q:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=niaCFo3dasU:MKchPUv0x-Q:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/niaCFo3dasU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/08/17/media-tags-2-2-plugin-for-wordpress-released/feed/</wfw:commentRss>
		<slash:comments>106</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/08/17/media-tags-2-2-plugin-for-wordpress-released/</feedburner:origLink></item>
		<item>
		<title>Bobalu Cigar Co Featured on CNN Small Business</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/0r9BXXumN0Q/</link>
		<comments>http://www.codehooligans.com/2009/08/06/bobalu-cigar-co-featured-on-cnn-small-business/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 14:06:59 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Austin]]></category>
		<category><![CDATA[Bobalu Cigar Co]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[cigar]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=436</guid>
		<description><![CDATA[<p>When I&#8217;m in my office in the morning I generally have the morning <a href="http://www.cnn.com/CNN/Programs/morning.express/index.html">CNN Morning Express with Robin Meade</a> on. As I&#8217;m watching the muted television I see a very familiar face. It&#8217;s Jeff Lipton from <a href="http://www.livecigarrollers.com/">Bobalu Cigar Company</a> here in Austin.&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m in my office in the morning I generally have the morning <a href="http://www.cnn.com/CNN/Programs/morning.express/index.html">CNN Morning Express with Robin Meade</a> on. As I&#8217;m watching the muted television I see a very familiar face. It&#8217;s Jeff Lipton from <a href="http://www.livecigarrollers.com/">Bobalu Cigar Company</a> here in Austin. I had to go track the video on CNN.com to share. </p>
<p><script src="http://i.cdn.turner.com/cnn/.element/js/2.0/video/evp/module.js?loc=dom&#038;vid=/video/living/2009/08/03/sbs.boblau.cigars.cnn" type="text/javascript"></script><noscript>Embedded video from <a href="http://www.cnn.com/video">CNN Video</a></noscript></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=0r9BXXumN0Q:YwIkW174ifo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=0r9BXXumN0Q:YwIkW174ifo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=0r9BXXumN0Q:YwIkW174ifo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=0r9BXXumN0Q:YwIkW174ifo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=0r9BXXumN0Q:YwIkW174ifo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=0r9BXXumN0Q:YwIkW174ifo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=0r9BXXumN0Q:YwIkW174ifo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=0r9BXXumN0Q:YwIkW174ifo:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/0r9BXXumN0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/08/06/bobalu-cigar-co-featured-on-cnn-small-business/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/08/06/bobalu-cigar-co-featured-on-cnn-small-business/</feedburner:origLink></item>
		<item>
		<title>The correct method of adding JavaScript to a WordPress theme</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/-LiQ7388gfA/</link>
		<comments>http://www.codehooligans.com/2009/07/22/the-correct-method-of-adding-javascript-to-a-wordpress-theme/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 02:54:29 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=421</guid>
		<description><![CDATA[<p>A quick note to all the WordPress developments out there. If you are adding a standard JS library like jQuery or Prototype, chances are WordPress already includes a version as part of the core files. So no need to download&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A quick note to all the WordPress developments out there. If you are adding a standard JS library like jQuery or Prototype, chances are WordPress already includes a version as part of the core files. So no need to download your own copy and place in somewhere in the themes folder. </p>
<p>Many theme developer who rely on JS for different effects simple place the link into the template header.php. Something like this:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span> <br />
&nbsp; &nbsp;src<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://localhost/wp-content/themes/mytheme/js/jquery/jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>While this does accomplish the goal of loading the JS library it also increases the chances of a second instance of the library also being loaded. Thus bloating your site. </p>
<p>A better option in my opinion is to add a little code to the themes functions.php file. The theme file functions.php is standard in most WordPress themes and is considered the best place to place common code that is needed by the theme. The functions.php file is automatically loaded by WordPress.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> my_functions_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_functions_init'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Note we are hooking into the WordPress &#8216;init&#8217; logic. We must setup the JS loading early. Some time later WordPress will load the theme. If the theme header used the theme function &#8216;wp_head()&#8217; then our JS library will automatically be included. The &#8216;wp_head()&#8217; function allows plugin author to insert needed JS and CSS files dynamically. Using this hook we are doing the same thing for our theme. No more hard coding the JS file link. </p>
<h3>So how is this really &#8220;Better&#8221;?</h3>
<p>The biggest benefit is we are preventing multiple copied of the same JS library from being loaded by WordPress or plugins. If we did hard code the JS link for jQuery and we also installed some plugin like cforms which used the jQuery library then it will load it&#8217;s own copy. By using the &#8216;wp_enqueue_script()&#8217; function we are letting WordPress know we need jQuery loaded. When the plugin is loaded it will also tell WordPress is needs to load jQuery. As a result WordPress can track what JS files need to be inserted via the &#8216;wp_header()&#8217; function. </p>
<p>For more information on the &#8216;wp_enqueue_script()&#8217; function check the WordPress Codex<br />
<a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">http://codex.wordpress.org/Function_Reference/wp_enqueue_script</a> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=-LiQ7388gfA:mUPWIEU7BXU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=-LiQ7388gfA:mUPWIEU7BXU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=-LiQ7388gfA:mUPWIEU7BXU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=-LiQ7388gfA:mUPWIEU7BXU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=-LiQ7388gfA:mUPWIEU7BXU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=-LiQ7388gfA:mUPWIEU7BXU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=-LiQ7388gfA:mUPWIEU7BXU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=-LiQ7388gfA:mUPWIEU7BXU:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/-LiQ7388gfA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/07/22/the-correct-method-of-adding-javascript-to-a-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/07/22/the-correct-method-of-adding-javascript-to-a-wordpress-theme/</feedburner:origLink></item>
		<item>
		<title>Media Tags 2.0 released</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/yK_CVhnGt_s/</link>
		<comments>http://www.codehooligans.com/2009/07/15/media-tags-20-released/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 17:41:02 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[media-tags]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=392</guid>
		<description><![CDATA[<p>Today I would like to finally release to the wild the totally rewritten Media-Tags plugin version 2.0. The Media-Tags plugin 2.0 has been completely rewritten to use to WordPress Taxonomy system for storing related media-tag information. As a benefit to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Today I would like to finally release to the wild the totally rewritten Media-Tags plugin version 2.0. The Media-Tags plugin 2.0 has been completely rewritten to use to WordPress Taxonomy system for storing related media-tag information. As a benefit to this rewrite the user now has a new Media Tags management interface located under the Media section. Via this Media Tags management interface users can better manage the media tags used on the site. Deleting, renaming and adding new media tags is now quite simple. The Media Tags for the attachment are still display both under Media and the media popup on the editor screen as before. <span id="more-392"></span></p>
<p>Some highlighted features in the new Media-Tags 2.0 release:</p>
<h2>Media tags storage now using WordPress Taxonomy</h2>
<p>In previous versions of the Media-Tags plugin the tag information was stored into the postmeta table. While this worked well it meant the tag information was only accessible in relationship to the post parent. The Media-Tags 2.0 version now uses the built-in WordPress Taxonomy system. Using this system greatly increases the flexibility of the media tag data. Using the standard WordPress functions get_terms() for example to directly query media tag information. </p>
<h2>Permalinks Support</h2>
<p>Because the media tags plugin now uses the WordPress Taxonomy system you can now access attachments archives via the new permalink tag &#8216;/media-tags/&#8217;. This is very powerful and one of the most requested features since the plugins initial release. An example of a media tag archive is something similar to </p>
<p>	http://www.yoursite.com/media-tags/&lt;media tag name&gt;</p>
<p>where &#8216;&lt;media tag name&gt;&#8217; is one media tag name from your site. </p>
<h2>Media Tags Archive</h2>
<p>Along the same lines as the new permalink structure you can now also use archive template files specific for media tags. By default WordPress will use the template file &#8216;archive.php&#8217; if part of your theme. While this works fine you may also want to have a template file specific for displaying media tags archive. Introducing the &#8216;mediatags.php&#8217; template file. The mediatags.php template is looks and functions much like a normal archive.php file complete with the header, footer, sidebar options as well as the standard WordPress loop. Actually my recommendation is to copy the existing archive.php to mediatags.php to start. Then add needed code to finish out the template file. Also you may define tag specific template files.  Lets assume you have many media tags in your system. But one media tag, &#8216;bulk&#8217;, for example you want displayed a certain way. You can define a tag specific template file like &#8216;mediatags-23.php&#8217; where &#8216;23 is the ID of that media tag.  Please not the template file when used will display attachments not the parent post. In WordPress all uploaded media is part of a parent/child association. Unlike the normal post related template the media tag template display the actual media files. </p>
<h2>Media-Tags Management interface</h2>
<p>In version 2.0 of the Media-Tags plugin I&#8217;ve included a new management screen. When the plugin is activated you will see a new menu options &#8216;Media-Tags&#8217; located under the top-level Media section. This management screen lets you add, delete, update media tags in your system. The interface should seem very familiar to user who use the WordPress Categories and Tags management screens. </p>
<h2>Template functions</h2>
<p>Also included as part of the plugin rewrite are some handy template tags to use via your theme. Below are a list of the template functions available. These are located in the plugin file mediatags_template_functions.php. All these functions should seem very familiar since they were modeled after the built-in WordPress tags template functions. </p>
<ul>
<li>is_mediatag() &#8211; Tests is we are displaying a media-tags archive. Much like is_category() function</li>
<li>in_mediatag() &#8211; Tests is an attachment post marked in a certain mediatag_id.</li>
<li>get_mediatags()</li>
<li>list_mediatags() &#8211; Very handy for listing your media tags like list_tags() in the sidebar.php</li>
<li>get_mediatag_link() &#8211; Given a mediatag_id this functon will return a link href value. </li>
<li>the_mediatags() &#8211; Very much like the post-level the_tags() to display a comma separated list of tags for a given post item. Used then displaying media tags archives. </li>
</ul>
<p>The original plugin function mediatags->get_media_by_tag(&#8230;) has now been replaced with a more simple non-object based template function get_attachments_by_media_tags(&#8230;). The original function has been deprecated and will be removed in future releases. </p>
<h2>More options for Media-Tag Queries</h2>
<p>The new Media Tags access function, get_attachments_by_media_tags(&#8230;), now supports many more parameters to let you filter the returned information better. </p>
<ul>
<li>media_tags: (Required) This is a comma separated list of tags you want to filter on. </li>
<li>media_types: (Optional) This is a comma separated list of media types &#8211; gif, pdf, png to return</li>
<li>post_parent: (Optional) This is the post ID of the related media items. This item is no longer required. This allows you to query media_tag items across all posts</li>
<li>numberposts: (Optional) Default is all. Allows control over the number of items returned.</li>
<li>orderby: (Optional) Default menu_order. See get_posts() for full list of options</li>
<li>order: (Optional) Default &#8216;DESC&#8217;. Controls the order of items. Other option is &#8216;ASC&#8217;.</li>
<li>offset: (Offset) Default is 0. Allows control over the subset of items returned.</li>
<li>return_type: (Optional) Defaults to Array. Other option is &#8216;li&#8217;. In the case of shortcodes the return type is &#8216;li&#8217; by default. When using the &#8216;li&#8217; return type each element is given a class of &#8216;media_tag_list&#8217; and an id of &#8216;media-tag-item-xxxx&#8217; where &#8216;xxx&#8217; is the attachment id.</li>
<li>tags_compare: (Optional) Defaults to &#8216;OR&#8217;. When requesting multiple media_tags elements allow a compare between the lists of items returned. When using the &#8216;OR&#8217; option returned item will be in one or more of the requested media_tags values. Other value is &#8216;AND&#8217;. When using &#8216;AND&#8217; you are requesting only attachments which are in all requested media_tags. </li>
</ul>
<h2>Shorcode support</h2>
<p>The media tags plugin now support the use of shortcodes. In its simplest form the media tag shortcode appears like </p>
<p>	[media-tags media_tags="alt-views,page-full,thumb"]</p>
<p>Note you need to include quotes around the element value to ensure proper handling. The shortcode parameters available are pretty close to the direct function call. The exception is you need to specify the parameter name and value pairs. </p>
<p>	[media-tags media_tags="alt-views,page-full,thumb" tags_compare="AND" orderby="menu_order"]</p>
<p>When using the shortcode option the return type is automatically set the &#8216;li&#8217; which means list elements will be returned. When using shortcodes you can specific two parameters &#8216;before_list=&#8217; and &#8216;after_list=&#8217; to control the wrapper elements. Also, you can specify a new parameter &#8216;display_item_callback=&#8217;. This parameter will be a user defined function which allows you to control the output. The callback function will be called for each found element. Check the plugin file &#8216;mediatags_shortcodes.php&#8217;. There is a function used &#8216;default_item_callback()&#8217; which is the default callback actually used by the plugin. Remember when using shortcodes in WordPress you MUST return every output. Do not echo information.</p>
<p>Lastly, when using the shortcode feature you may have a time when you need to specify the post_parent for the media_tags queried. Now you could add the post_parent ID directly to the shortcode settings. But then you would be hard-coding the ID for the given post. A better way is to just set the post_parent value to &#8216;this&#8217;. This will allow dynamic control over the shortcode processing. </p>
<p>	[media-tags media_tags="alt-views,page-full,thumb" post_parent="this" before_list="&lt;ul class='frank'&gt;" after_list="&lt;/ul&gt;"]</p>
<h2>Download</h2>
<p>As is customary the only place you should ever download released plugins is via the WordPress official plugin repository.<br />
Download the new <a href="http://wordpress.org/extend/plugins/media-tags/">Media-Tags 2.0 plugin</a> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=yK_CVhnGt_s:C0-s8g_hiRQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yK_CVhnGt_s:C0-s8g_hiRQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yK_CVhnGt_s:C0-s8g_hiRQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yK_CVhnGt_s:C0-s8g_hiRQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yK_CVhnGt_s:C0-s8g_hiRQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yK_CVhnGt_s:C0-s8g_hiRQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yK_CVhnGt_s:C0-s8g_hiRQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yK_CVhnGt_s:C0-s8g_hiRQ:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/yK_CVhnGt_s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/07/15/media-tags-20-released/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/07/15/media-tags-20-released/</feedburner:origLink></item>
		<item>
		<title>Media Tags 2.0 Beta</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/txQAEKxt4FM/</link>
		<comments>http://www.codehooligans.com/2009/07/08/media-tags-20-beta/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 21:27:04 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[media-tags]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=352</guid>
		<description><![CDATA[<p>Today I&#8217;d like to release the first public beta of the Media Tags plugin. This is an exciting change and almost complete rewrite to the core plugin code. </p>
<p>For anyone downloading this beta please be aware <em>this is a beta&#8230;</em></p>]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;d like to release the first public beta of the Media Tags plugin. This is an exciting change and almost complete rewrite to the core plugin code. </p>
<p>For anyone downloading this beta please be aware <em>this is a beta version and subject to change in the near future</em>. Also <strong>since this is a beta it is recommended NOT to use this on a production system. User beware!</strong> If you do download the plugin and test if please using the <a href="#respond">comment</a> form below to mention any issue you have with the new plugin. I can only test thing to a certain level with my own client sites.</p>
<p>This new beta has been tested on WordPress versions 2.7.1 and 2.8 only! At this time I&#8217;ve not tested the new Media-Tags Management interface on any lower version of WordPress. </p>
<p><span id="more-352"></span></p>
<p>Some highlighted features:</p>
<ol>
<li><strong>Moved the media tag storage to the WordPress Taxonomy system.</strong> The original version of the plugin used the WordPress media_meta data structure to store the comma separated list of Media Tags. The media_meta information is associated with the actual attachment. The problem is in order to access this information you need to have the post parent key. Since the serialized media_meta information is stored in such a way the search for items based on media tag value was mainly impossible. By using the built-in WordPress Taxonomy system queries against the media-tags is now much more flexible. When upgrading from a previous version of the media-tags plugin please deactivate then activate the plugin. During this activation step the existing media-tags are converted into the new Taxonomy. Note the old media tags are not removed from the postmeta table. This is in case something goes wrong and you need to downgrade the plugin. </li>
<li><strong>New Media Tags Management interface.</strong> Because the storage of the media tags is now more integrated with the WordPress core Taxonomy system the next logic development step was to provide an interface where users could manage the media tags. I give you the Media Tags Management panel. When the plugin is activated there is a new menu option added to the Media section sub-menu. </li>
<li><strong>New media-tags URL rewrite functionality.</strong> Again as a benefit of using the WordPress Taxonomy system I&#8217;ve setup a new /media-tags/ rewrite functionality. This means you can do something like http://www.somesite.com/media-tags/tagname. Or if the site is not using permalinks the URL will appears something like this http://www.somesite.com/?media-tag=tagname. This functionality is automatic. </li>
<li><strong>Media-Tag templates.</strong> Now in your theme you can define a template file &#8216;mediatag.php&#8217; to be called when displaying a media-tag archive. This works much like the WordPress category.php template. You can also define a media tag specific template file like mediatag-xx.php when &#8216;xx&#8217; is the media tag term id</li>
<li><strong>Replace legacy template function.</strong> In the original version of the media-tags plugin I provided the single hook into the plugin, get_media_by_tag(). This function is still supported. I&#8217;ve also added a new template function, get_attachments_by_media_tags().
<p>This new function accepts any more parameters like: </p>
<ul>
<li>media_tags &#8211; comma seperated list of media_tag values.</li>
<li>media_types &#8211; comma seperated list of media_types values.</li>
<li>post_parent &#8211; This is now an optional parameter and will limit the selection of attachments to those from the post_parent Id. Possible future enhancement to this will be allowing a comma separated list of post ids.</li>
<li>numberposts, orderby, order offset &#8211; Standard list of WordPress options. See the <a href="http://codex.wordpress.org/Template_Tags/get_posts">get_posts() template function</a> for details. </li>
<li>return_type</li>
<li>tags_compare &#8211; Possible values are: &#8216;OR&#8217; (default) or &#8216;AND&#8217;. Used only when requests with  more than one media_tag value.   With the &#8216;OR&#8217; option you want attachments associated with either media_tag. With &#8216;AND&#8217; you want only attachments associate  with both.</li>
<li>display_item_callback &#8211; This is a user defined callback function. If provided it let&#8217;s you control the display of the individual attachment item. This is handy for example when using the shortcode feature. More on shortcodes below.</li>
</ul>
</li>
<li><strong>Shortcodes for drop into content easy of use</strong>. This is a little something extra and requested by many as the need to have feature in the next version of the plugins. Quite simply I added the new shortcode ability to the plugin. How do you use it? Simply add the shortcode code [media-tags] to your page content. Just as with the new template function, get_attachments_by_media_tags() it can take many parameters like the following which will filter the display. <br />
[media-tags media_tags="alt-views,page-full,thumb" tags_compare="AND" orderby="menu_order" display_item_callback="some_function"]</p>
<p>When using shortcode the return type will always be an unordered list. you will need to supply the &lt;ul&gt;&lt;/ul&gt; or &lt;ol&gt;&lt;/ol&gt; elements before and after the shortcode call. My reasoning here is to allow the user the ability to ID or CLASS the top-level list wrapper as needed. But I&#8217;m torn. Thoughts?</p>
<p>Notice the last parameter &#8216;display_item_callback&#8217;. This is a user defined function that will be called for each element of the returned list. It is important to note that per the WordPress use of shortcodes the user defined function needs to return the value not echo it from within the function. I&#8217;ve provided an example of a callback function in the file mediatags_shortcode.php. This default function is actually used by the plugin when displaying shortcode items.</li>
<li><strong>Event more template functions.</strong> In addition to the new get_attachments_by_media_tags() function I&#8217;ve also added a number of other template functions to be used in your theme.
<ul>
<li>is_mediatag() &#8211; Simpler to the WordPress is_category() or is_tag() template functions. If you are viewing a media-tags archive this will return true.</li>
<li>in_mediatag() &#8211; Similar to the WordPress in_category() function. Pass in a media-tag term id to check. If matching will return true.</li>
<li>mediatags_get_list() &#8211; Similar to the wp_list_categories() function will list all media-tags. Nice for the sidebar.</li>
<li>mediatags_get_link() &#8211; Pass in a media-tag term id and the link for that media-tag will be returned. </li>
</ul>
</li>
<li><strong>media-tag tag cloud.</strong> This is still under development and probably will not make it into the initial 2.0 release. This is to be template function and/or widget that will display the weighted media-tags used in your site. </li>
</ol>
<p>Download media-tags 2.0 Beta A now!<br />
<a href='http://www.codehooligans.com/wp-content/uploads/media-tags-20-betaa.zip'>Media-tags plugin version 2.0 Beta A</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=txQAEKxt4FM:qS7bXsL9GR4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=txQAEKxt4FM:qS7bXsL9GR4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=txQAEKxt4FM:qS7bXsL9GR4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=txQAEKxt4FM:qS7bXsL9GR4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=txQAEKxt4FM:qS7bXsL9GR4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=txQAEKxt4FM:qS7bXsL9GR4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=txQAEKxt4FM:qS7bXsL9GR4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=txQAEKxt4FM:qS7bXsL9GR4:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/txQAEKxt4FM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/07/08/media-tags-20-beta/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/07/08/media-tags-20-beta/</feedburner:origLink></item>
		<item>
		<title>World’s Longest Scooter</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/yMhef_7UzeA/</link>
		<comments>http://www.codehooligans.com/2009/04/23/worlds-longest-scooter/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 16:40:51 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[scooters]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=326</guid>
		<description><![CDATA[<p><img src="http://www.codehooligans.com/wp-content/uploads/mini_cooper_limo-300x224.jpg" alt="Cooper Mini Limo" title="Cooper Mini Limo" width="300" height="224" class="alignright size-medium wp-image-329" /> I&#8217;m not really sure what prompted these guys to do it. Maybe boredom. Maybe they wanted to climb the mountain because the mountain was there. Or just maybe they saw the Cooper Mini Limo and thought to do the same&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.codehooligans.com/wp-content/uploads/mini_cooper_limo-300x224.jpg" alt="Cooper Mini Limo" title="Cooper Mini Limo" width="300" height="224" class="alignright size-medium wp-image-329" /> I&#8217;m not really sure what prompted these guys to do it. Maybe boredom. Maybe they wanted to climb the mountain because the mountain was there. Or just maybe they saw the Cooper Mini Limo and thought to do the same thing with a scooter. I&#8217;m not just impressed with the mechanical abilities viewed in this video. I&#8217;m also super impressed that most of it s done while wearing a tie. Obviously this is one of those foreign films. <img src='http://www.codehooligans.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The &#8220;long&#8221; scooter is quite impressive. There is a seat in the front for steering and another one in the back for&#8230;riding. If I had the parts I would add another steering section in the rear sort of like the Fire Engine Ladder trucks. Might make it easier to round a normal street corner.</p>
<p>Have a look at the video below or view from the <a href="http://www.liveleak.com/view?i=303_1239426928">original page</a> on LiveLeak.com </p>
<p><object width="450" height="370"><param name="movie" value="http://www.liveleak.com/e/303_1239426928"></param><param name="wmode" value="transparent"></param><embed src="http://www.liveleak.com/e/303_1239426928" type="application/x-shockwave-flash" wmode="transparent" width="450" height="370"></embed></object></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=yMhef_7UzeA:1dnUebDvnoE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yMhef_7UzeA:1dnUebDvnoE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yMhef_7UzeA:1dnUebDvnoE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yMhef_7UzeA:1dnUebDvnoE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yMhef_7UzeA:1dnUebDvnoE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yMhef_7UzeA:1dnUebDvnoE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=yMhef_7UzeA:1dnUebDvnoE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=yMhef_7UzeA:1dnUebDvnoE:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/yMhef_7UzeA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/04/23/worlds-longest-scooter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/04/23/worlds-longest-scooter/</feedburner:origLink></item>
		<item>
		<title>The Austin Scooter Club has a new Website</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/68UHehrjQpY/</link>
		<comments>http://www.codehooligans.com/2009/04/22/austin-scooter-club-website/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:57:09 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Austin]]></category>
		<category><![CDATA[Austin Scooter Club]]></category>
		<category><![CDATA[club]]></category>
		<category><![CDATA[rally]]></category>
		<category><![CDATA[scooters]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=295</guid>
		<description><![CDATA[<p><img alt="" src="http://farm4.static.flickr.com/3027/2668820408_dd03f80c86_m.jpg" title="Red Lance Vintage 150cc" width="240" height="180" class="alignright" /> Last year as the gas prices were steadily increased to the summer high point of $4.00/gallon, Sondra and I purchased a pair of scooters, so we could run around on the weekends and take some burden off our wallets. I&#8217;m&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://farm4.static.flickr.com/3027/2668820408_dd03f80c86_m.jpg" title="Red Lance Vintage 150cc" width="240" height="180" class="alignright" /> Last year as the gas prices were steadily increased to the summer high point of $4.00/gallon, Sondra and I purchased a pair of scooters, so we could run around on the weekends and take some burden off our wallets. I&#8217;m self-employed so just needed something simple to run down to the coffee shop and work for the day.  Last year we also joined the local <a href="http://www.meetup.com/scootaustin/">Austin Scooter Club</a>. Maybe another victim of the economy of maybe just wanting more control over the actual site, Mary and the gang have transitioned the group over to self-hosted WordPress site. Announcing the brand new <a href="http://austin.scootclub.com/">Austin Scooter Club</a> baby. It looks really good and I&#8217;m ready to help fill it up with links and other scooter information I&#8217;ve gathered over the last year. Not happy about using the choice of phpBB forum. Seemed more functional to use Google Groups like other groups. </p>
<p>Also, if you&#8217;re a scooter owner and living in the general Austin area don&#8217;t forget to register for the <a href="http://www.fistfullofscooters.com/">First Full of Scooters Rally</a> coming up May 1st. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=68UHehrjQpY:jKIpdhWaGnw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=68UHehrjQpY:jKIpdhWaGnw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=68UHehrjQpY:jKIpdhWaGnw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=68UHehrjQpY:jKIpdhWaGnw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=68UHehrjQpY:jKIpdhWaGnw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=68UHehrjQpY:jKIpdhWaGnw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=68UHehrjQpY:jKIpdhWaGnw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=68UHehrjQpY:jKIpdhWaGnw:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/68UHehrjQpY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/04/22/austin-scooter-club-website/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/04/22/austin-scooter-club-website/</feedburner:origLink></item>
		<item>
		<title>Too Young for a Teen Tan in Texas</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/ql0vR0mEmfA/</link>
		<comments>http://www.codehooligans.com/2009/04/21/too-young-for-a-teen-tan-in-texas/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 21:19:01 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Useless Lawmakers]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=267</guid>
		<description><![CDATA[<p>This afternoon the Texas House passed a measure that would prevent teens under the age of 16.5 years from being able to use public Tanning beds like those found at Dark Tan and other pay for use salons across the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This afternoon the Texas House passed a measure that would prevent teens under the age of 16.5 years from being able to use public Tanning beds like those found at Dark Tan and other pay for use salons across the state. Also part of the measure is a section to allow 18 and under (that would be anyone between the ages of 16.5 and 18) to use the tanning facilities but both the parent and the minor must sign an advisory that discusses the dangers of tanning. I equate this to the reading the terms and conditions when purchasing or installing online software.</p>
<p>What really pisses me off about this &#8216;measure&#8217; is the uselessness of it all. This is just another of a long line or changes to the state laws to protect the citizens from themselves. It&#8217;s no wonder the national economy is in the shitter these days. Instead of the State and National lawmaker focusing on long-term goals to make out country stronger, they spent their time and good taxpayer money writing up crap like this. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codehooligans?a=ql0vR0mEmfA:cbCwsPUnVTA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=ql0vR0mEmfA:cbCwsPUnVTA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=ql0vR0mEmfA:cbCwsPUnVTA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=ql0vR0mEmfA:cbCwsPUnVTA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=ql0vR0mEmfA:cbCwsPUnVTA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=ql0vR0mEmfA:cbCwsPUnVTA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/codehooligans?i=ql0vR0mEmfA:cbCwsPUnVTA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/codehooligans?a=ql0vR0mEmfA:cbCwsPUnVTA:5BYXUcS8iBU"><img src="http://feeds.feedburner.com/~ff/codehooligans?d=5BYXUcS8iBU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/ql0vR0mEmfA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2009/04/21/too-young-for-a-teen-tan-in-texas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2009/04/21/too-young-for-a-teen-tan-in-texas/</feedburner:origLink></item>
		<item>
		<title>Media tags plugin</title>
		<link>http://feedproxy.google.com/~r/codehooligans/~3/8R_xRG4oLmc/</link>
		<comments>http://www.codehooligans.com/2008/12/14/media-tags-plugin/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 17:29:34 +0000</pubDate>
		<dc:creator>Paul Menard</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[media-tags]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.codehooligans.com/?p=185</guid>
		<description><![CDATA[<blockquote><p><strong>Note: This post remains available to discuss the original 1.0 version of the Media Tags plugin. As of July 15 2009 version 2.0 of the Media Tags plugins has been released. Please refer to the update post <a href="http://www.codehooligans.com/2009/07/15/media-tags-20-released/">http://www.codehooligans.com/2009/07/15/media-tags-20-released/</a> for information on&#8230;</strong></p></blockquote>]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>Note: This post remains available to discuss the original 1.0 version of the Media Tags plugin. As of July 15 2009 version 2.0 of the Media Tags plugins has been released. Please refer to the update post <a href="http://www.codehooligans.com/2009/07/15/media-tags-20-released/">http://www.codehooligans.com/2009/07/15/media-tags-20-released/</a> for information on changes to the use of the plugin. </strong></p></blockquote>
<p>Working on a client project recently I needed to extract 2 attachments uploaded from a post and display these along with the post title into the sidebar on another page. I&#8217;ve done this a few times before and always sad to say a little different. Probably the best solution is to name the &#8217;special&#8217; attachments using some defined naming convention like image_sidebar_1.jpg, image_sidebar_2.jpg, image_sidebar_x.jpg. This works but can get ugly if you even want the client to follow your instructions on the naming conventions. </p>
<p>I&#8217;ve figured out a better way. With my latest plugin you can now add tags to your media attachments. I write &#8216;media&#8217; because this does not just apply to images. You can tag Word document, PDF documents basically anything you upload via the standard WordPress Media upload tool. </p>
<p>Here are some screenshots:</p>
<p><a href='http://www.codehooligans.com/wp-content/uploads/screenshot-1.png' rel="lightbox[185]"><img src="http://www.codehooligans.com/wp-content/uploads/screenshot-1.png" alt="The media tag input field is displayed directly on the media form." title="The media tag input field is displayed directly on the media form." width="500" height="459" class="aligncenter size-full wp-image-186" /></a></p>
<p><a href='http://www.codehooligans.com/wp-content/uploads/screenshot-2.png' rel="lightbox[185]"><img src="http://www.codehooligans.com/wp-content/uploads/screenshot-2.png" alt="" title="Media tags display via the Media Library Management interface." width="500" height="221" class="aligncenter size-full wp-image-188" /></a></p>
<h2>Usage</h2>
<p>So now you can tag you media files. But how do you actually use the tags? How to you actually access attachments that have &#8216;x&#8217; tag? Excellent question. And your answer is below.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$media_items</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mediatags</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_media_by_tag</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'media_tags=sidebar&amp;post_parent=6'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
This call will filter the tags <span style="color: #b1b100;">for</span> the tag <span style="color: #0000ff;">'sidebar'</span> and the post ID of 6<span style="color: #339933;">.</span><br />
The <span style="color: #000000; font-weight: bold;">function</span> take three arguments<span style="color: #339933;">.</span> <br />
media_tags <span style="color: #009900;">&#40;</span>Required<span style="color: #009900;">&#41;</span> This is the tag or tags you are filtering on<span style="color: #339933;">.</span> <br />
media_types <span style="color: #009900;">&#40;</span>Optional<span style="color: #009900;">&#41;</span> Lets you also filter by pdf<span style="color: #339933;">,</span> txt<span style="color: #339933;">,</span> etc<span style="color: #339933;">.</span><br />
post_parent <span style="color: #009900;">&#40;</span>Optional<span style="color: #009900;">&#41;</span> The ID of the attachment post<span style="color: #339933;">.</span> <span style="color: #b1b100;">If</span> not provided then the <span style="color: #000000; font-weight: bold;">global</span> post ID is assumed<span style="color: #339933;">.</span></div></td></tr></tbody></table></div>
<p>As part of the plugin I also wrote a function to be used in your template. To follow the example I started this article with I need to display 2 of the 5 uploaded images in the sidebar. My first step was to upload the images and tag the two special images with &#8217;sidebar&#8217;. </p>
<p>Now I use the function get_media_by_tag(). I pass the tag I want to access, in this case &#8217;sidebar&#8217; and the ID of the post parent. What is returned is an array of attachment items. This array is similar in fact to the return object when calling the WordPress get_posts which is partly what the function does. </p>
<p><a href="http://wordpress.org/extend/plugins/media-tags/">Download</a> the Media-Tags plugin via the WordPress.org plugin repository </p>
<h2>Future plans</h2>
<p>I&#8217;ve already starting thinking of some enhancements for the plugin. Which include a tag management screen and other utility functions. If you have any other needs post them here in the comments. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/codehooligans?a=mwwiYcVV"><img src="http://feeds.feedburner.com/~f/codehooligans?d=41" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/codehooligans?a=UMsqfgxO"><img src="http://feeds.feedburner.com/~f/codehooligans?i=UMsqfgxO" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/codehooligans?a=ivCRIyoB"><img src="http://feeds.feedburner.com/~f/codehooligans?i=ivCRIyoB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/codehooligans?a=1X2Fbofl"><img src="http://feeds.feedburner.com/~f/codehooligans?i=1X2Fbofl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/codehooligans?a=K2sQEgX6"><img src="http://feeds.feedburner.com/~f/codehooligans?d=2419" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codehooligans/~4/8R_xRG4oLmc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codehooligans.com/2008/12/14/media-tags-plugin/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><feedburner:origLink>http://www.codehooligans.com/2008/12/14/media-tags-plugin/</feedburner:origLink></item>
	</channel>
</rss>
