<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Weekly WordPress Tips</title>
	<atom:link href="http://weeklytips.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://weeklytips.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 11 Mar 2006 18:35:48 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='weeklytips.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Weekly WordPress Tips</title>
		<link>http://weeklytips.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://weeklytips.wordpress.com/osd.xml" title="Weekly WordPress Tips" />
	<atom:link rel='hub' href='http://weeklytips.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Weekly Tip 2: Using Snoopy to Fetch Content</title>
		<link>http://weeklytips.wordpress.com/2006/03/11/weekly-tip-2-using-snoopy-to-fetch-content/</link>
		<comments>http://weeklytips.wordpress.com/2006/03/11/weekly-tip-2-using-snoopy-to-fetch-content/#comments</comments>
		<pubDate>Sat, 11 Mar 2006 18:35:48 +0000</pubDate>
		<dc:creator>weeklytips</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://weeklytips.wordpress.com/2006/03/11/weekly-tip-2-using-snoopy-to-fetch-content/</guid>
		<description><![CDATA[Sorry for being a day late on this week&#8217;s tip, I got caught up in life last night. This week&#8217;s tip is a quick, but extremely useful tip. Often times plugins need to fetch some content over the web, or send a request back to a server to report some info. However, often times for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=9&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sorry for being a day late on this week&#8217;s tip, I got caught up in life last night. This week&#8217;s tip is a quick, but extremely useful tip. Often times plugins need to fetch some content over the web, or send a request back to a server to report some info. However, often times for security purposes, webhosts have disabled url wrappers for functions like <code>fopen</code>, leaving you without an easy way to send your request.</p>
<p>WordPress avoids this problem with a handy class called Snoopy, which uses sockets to make a request to remote servers and avoid the problem. Here&#8217;s a quick rundown on using Snoopy for some simple tasks.</p>
<blockquote><p>
/* First, we need to make an instance of the class */<br />
$snoopy = new Snoopy();<br />
/* Now we can fetch a url from the web */<br />
$result = $snoopy-&gt;fetch(&#8216;http://weeklytips.wordpress.com&#8217;);<br />
/* Check to make sure that it was fetched successfully*/<br />
if($result) {<br />
    /* Now the variable $snoopy-&gt;results contains the information you just fetched, for now we will just echo it out */<br />
    echo $snoopy-&gt;results;<br />
} else {<br />
    echo &#8216;We were not able to complete your request&#8217;;<br />
}
</p></blockquote>
<p>The power of Snoopy goes way beyond simple fetching of URLs, but for now this is all I will cover here. There are tons of good resources and tutorials for Snoopy on the web, so if you need to learn more, you can check those out for now. At some later date, I may also publish the portion of the book on some of Snoopy&#8217;s more advanced features, and how they relate with the rest of WordPress.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/weeklytips.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/weeklytips.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weeklytips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weeklytips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weeklytips.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=9&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weeklytips.wordpress.com/2006/03/11/weekly-tip-2-using-snoopy-to-fetch-content/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5306d3bee707809ff79a6b990348ca31?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weeklytips</media:title>
		</media:content>
	</item>
		<item>
		<title>Extra Tip: Object Oriented Plugin Development</title>
		<link>http://weeklytips.wordpress.com/2006/03/05/extra-tip-object-oriented-plugin-development/</link>
		<comments>http://weeklytips.wordpress.com/2006/03/05/extra-tip-object-oriented-plugin-development/#comments</comments>
		<pubDate>Sun, 05 Mar 2006 09:17:52 +0000</pubDate>
		<dc:creator>weeklytips</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://weeklytips.wordpress.com/2006/03/05/extra-tip-object-oriented-plugin-development/</guid>
		<description><![CDATA[Note:As this was slightly chopped together from the book itself, it has some references to an earlier example project provided by the book. Do not fret, you should be able to figure out what&#8217;s happening, the example is pretty easy (this assumes you know the basics of writing a procedural plugin first). To avoid function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=8&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong>As this was slightly chopped together from the book itself, it has some references to an earlier example project provided by the book. Do not fret, you should be able to figure out what&#8217;s happening, the example is pretty easy (this assumes you know the basics of writing a procedural plugin first).</p>
<p>	To avoid function collision and pollution, many people have wanted to resort to building plugins with classes and methods instead of prefixed functions for their plugins. WordPress has the capability out of the box to support these sorts of plugins, but unfortunately the documentation around them is lacking. </p>
<h3>Adapting Procedural Plugins</h3>
<p>	To show the differences between procedural and object oriented plugins, we&#8217;re going to first adapt the simple plugin from our first example to show the basic differences. If you don&#8217;t already know how to write in PHP style object oriented syntax, it may be in your best interest to read a bit of the php.net documentation (<a href="http://php.net/OOP">4</a>, <a href="http://php.net/oop5">5</a>) on the subject first. Our original procedural plugin for profanity filtering looked like this:</p>
<blockquote><p>
function prefix_filter_profanity($content = &#8221;) {<br />
	$profane_things = array(&#8216;water&#8217;, &#8216;cold&#8217;, &#8216;fast&#8217;, &#8216;cheese&#8217;);<br />
	$clean_things = array(&#8216;wine&#8217;, &#8216;hot&#8217;, &#8216;slow&#8217;, &#8216;pasta&#8217;);<br />
	$filtered_text = str_replace($profane_things, $clean_things, $unfiltered_text);<br />
	return $filtered_text;<br />
}<br />
add_filter(&#8216;the_content&#8217;, &#8216;prefix_filter_profanity&#8217;);<br />
add_filter(&#8216;comment_text&#8217;, &#8216;prefix_filter_profanity&#8217;);
</p></blockquote>
<p>Adapting the plugin is incredibly simple.</p>
<blockquote><p>
class Profanity_Filter() {<br />
	/* This is for PHP5, which uses a new magical function as the constructor */<br />
	function __construct() {<br />
		$this-&gt;Profanity_Filter();<br />
	}<br />
	function Profanity_Filter() {<br />
		add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
		add_filter(&#8216;comment_text&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
	}<br />
	function filter() {<br />
		$profane_things = array(&#8216;water&#8217;, &#8216;cold&#8217;, &#8216;fast&#8217;, &#8216;cheese&#8217;);<br />
		$clean_things = array(&#8216;wine&#8217;, &#8216;hot&#8217;, &#8216;slow&#8217;, &#8216;pasta&#8217;);<br />
		$filtered_text = str_replace($profane_things, $clean_things, $unfiltered_text);<br />
		return $filtered_text;<br />
	}<br />
}<br />
$profanity_filter = new Profanity_Filter;
</p></blockquote>
<p>The first look at this class may be a little overwhelming. The code has gotten considerably longer, but this is an exception rather than the rule, as longer plugins will often have their size cut down.</p>
<p>Let&#8217;s step through bit by bit.</p>
<blockquote><p>
	function __construct() {<br />
		$this-&gt;Profanity_Filter();<br />
	}<br />
	function Profanity_Filter() {<br />
		add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
		add_filter(&#8216;comment_text&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
	}
</p></blockquote>
<p>The first function, __construct, is for PHP5 and future versions. It basically ensures that the old style constructor, the method that matches the class&#8217;s name, is run when the class is created. The function Profanity_Filter is the old style constructor for PHP4. This function registers the actions for filtering on the content and comment text. This is similar to the old code, except the second argument, the callback function. Instead of passing in a function name as a string, you pass in an array, which corresponds to the PHP callback type. The callback type tells PHP how to find the function or method that its looking for. The first item in the array is a reference to $this, which is a reserved variable pointing to the current instance of the class. The second argument is the string name of the method inside the function that should be run as the filter, just like before.</p>
<p>This code can also be written in a second way, if your goal is solely to avoid name collisions. </p>
<blockquote><p>
class Profanity_Filter() {<br />
	function Profanity_Filter() {<br />
		add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
		add_filter(&#8216;comment_text&#8217;, array(&amp;$this, &#8216;filter&#8217;));<br />
	}<br />
	function filter() {<br />
		$profane_things = array(&#8216;water&#8217;, &#8216;cold&#8217;, &#8216;fast&#8217;, &#8216;cheese&#8217;);<br />
		$clean_things = array(&#8216;wine&#8217;, &#8216;hot&#8217;, &#8216;slow&#8217;, &#8216;pasta&#8217;);<br />
		$filtered_text = str_replace($profane_things, $clean_things, $unfiltered_text);<br />
		return $filtered_text;<br />
	}<br />
}<br />
/* ClassName::Method and array(&#8216;ClassName&#8217;, &#8216;Method&#8217;) are both valid static callback types */<br />
add_filter(&#8216;the_content&#8217;, &#8216;Profanity_Filter::filter&#8217;);<br />
add_filter(&#8216;comment_text&#8217;, array(&#8216;Profanity_Filter&#8217;, &#8216;filter&#8217;));
</p></blockquote>
<p>This method uses static calling of methods instead of requiring that you create an instance of a class. The best idea is to choose which method you use based on what your plugin needs to do. If you have code that would normally be written as object oriented code with multiple objects, the former method is the way for you, while the latter example is just for avoiding function name collisions.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/weeklytips.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/weeklytips.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weeklytips.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weeklytips.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weeklytips.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=8&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weeklytips.wordpress.com/2006/03/05/extra-tip-object-oriented-plugin-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5306d3bee707809ff79a6b990348ca31?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weeklytips</media:title>
		</media:content>
	</item>
		<item>
		<title>Extra Tip: Removing Admin Menus</title>
		<link>http://weeklytips.wordpress.com/2006/03/04/extra-tip-removing-admin-menus/</link>
		<comments>http://weeklytips.wordpress.com/2006/03/04/extra-tip-removing-admin-menus/#comments</comments>
		<pubDate>Sat, 04 Mar 2006 22:06:18 +0000</pubDate>
		<dc:creator>weeklytips</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://weeklytips.wordpress.com/2006/03/04/extra-tip-removing-admin-menus/</guid>
		<description><![CDATA[While writing various plugins, I&#8217;ve come across the need (or want more likely) to remove some entries from the WordPress admin menus. While there isn&#8217;t an immediate API hook for this, there is still a quick bit of code to allow you to remove the items. Let&#8217;s say for example that we would like to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=7&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While writing various plugins, I&#8217;ve come across the need (or want more likely) to remove some entries from the WordPress admin menus. While there isn&#8217;t an immediate API hook for this, there is still a quick bit of code to allow you to remove the items. Let&#8217;s say for example that we would like to remove the Comments menu under Manage. If you look in /wp-admin/menu.php, you&#8217;ll find something like the following (unimportant bits stripped out of course):</p>
<blockquote><p>
$menu[10] = array(__(&#8216;Manage&#8217;), &#8216;edit_posts&#8217;, &#8216;edit.php&#8217;);<br />
&#8230;<br />
$submenu['edit.php'][20] = array(__(&#8216;Comments&#8217;), &#8216;edit_posts&#8217;,      &#8216;edit-comments.php&#8217;);
</p></blockquote>
<p>Each item in the $menu array represents a top-level menu item, while each item in the $submenu array represents one of the submenu pages. So how can we remove the menus? unset() of course.</p>
<blockquote><p>
function prefix_remove_menu() {<br />
	global $submenu;<br />
	unset($submenu['edit.php'][20]);<br />
}<br />
add_action(&#8216;admin_header&#8217;, &#8216;prefix_remove_menu&#8217;);
</p></blockquote>
<p>If you really wanted, you could change that to something like this, and remove top menu items instead.</p>
<blockquote><p>
function prefix_remove_menu() {<br />
	global $menu;<br />
	unset($menu[10]);<br />
}<br />
add_action(&#8216;admin_header&#8217;, &#8216;prefix_remove_menu&#8217;);
</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/weeklytips.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/weeklytips.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weeklytips.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weeklytips.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weeklytips.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=7&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weeklytips.wordpress.com/2006/03/04/extra-tip-removing-admin-menus/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5306d3bee707809ff79a6b990348ca31?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weeklytips</media:title>
		</media:content>
	</item>
		<item>
		<title>Weekly Tip 1: Peacefully Degrading Template Tags</title>
		<link>http://weeklytips.wordpress.com/2006/03/03/weekly-tip-1-peacefully-degrading-template-tags/</link>
		<comments>http://weeklytips.wordpress.com/2006/03/03/weekly-tip-1-peacefully-degrading-template-tags/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 09:54:10 +0000</pubDate>
		<dc:creator>weeklytips</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://weeklytips.wordpress.com/2006/03/03/weekly-tip-1-peacefully-degrading-template-tags/</guid>
		<description><![CDATA[Welcome to the first (well, so called weekly) WordPress tips post. This blog is dedicated to giving out tips to WordPress plugin developers and possibly even theme authors on little tricks you may or may not have known were possible with WordPress. Keep your eyes peeled every Friday for a guaranteed new tip, and occasionally [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=6&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to the first (well, so called weekly) WordPress tips post. This blog is dedicated to giving out tips to WordPress plugin developers and possibly even theme authors on little tricks you may or may not have known were possible with WordPress. Keep your eyes peeled every Friday for a guaranteed new tip, and occasionally days inbetween for some extras. And now stand by for this week&#8217;s tip.</p>
<p>A problem that many plugin developers face is having plugins that provide template tags that will gracefully fail when their plugin is removed. A majority of current plugins simply have a function that you call, similar to all of the other template tags, to place the output in your themes. The problem is that if a user uninstalls the plugin, they are now faced with a fatal PHP error in their theme because your function can no longer be found.<span id="more-6"></span></p>
<p>The solution to this problem is simple, but rarely used, probably because not many people outside of the mailing lists have seen the trick before. The solution? Hooks. Instead of telling a user to place a function call in their templates, you could tell them instead to copy and paste a little code snippet like this:</p>
<blockquote><p>do_action(&#8216;my_plugin_action&#8217;);</p></blockquote>
<p>Alone, this call to do_action does nothing, and is similar to what you would find scattered about the WordPress code and themes that provide the standard set of hooks. But try adding a line in your plugin like this:</p>
<blockquote><p>add_action(&#8216;my_plugin_action&#8217;, &#8216;my_template_tag&#8217;);</p></blockquote>
<p>Together, you&#8217;ve created a template tag to be copied and pasted into themes, that no longer kills sites when your plugin is deactivated. With this new template tag, you open up the doors for easy, clean integration with themes. Instead of trying to explain how to wrap your template tags in <code>if(function_exists())</code> to the template designer who doesn&#8217;t understand PHP, they can once again copy and paste tiny snippets of code, providing a better user experience for everyone.</p>
<p>And as always, remember to prefix your functions and hook names with something unique, so that you don&#8217;t collide with other plugins.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/weeklytips.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/weeklytips.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/weeklytips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/weeklytips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/weeklytips.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=weeklytips.wordpress.com&amp;blog=134881&amp;post=6&amp;subd=weeklytips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://weeklytips.wordpress.com/2006/03/03/weekly-tip-1-peacefully-degrading-template-tags/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5306d3bee707809ff79a6b990348ca31?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">weeklytips</media:title>
		</media:content>
	</item>
	</channel>
</rss>
