<?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/"
	>

<channel>
	<title>Web development &#187; Phase 2</title>
	<atom:link href="http://sourcecodemoney.com/tag/phase-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://sourcecodemoney.com</link>
	<description>Use source code for money</description>
	<lastBuildDate>Mon, 21 Nov 2011 12:03:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to make wordpress plugin: General</title>
		<link>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/</link>
		<comments>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 11:57:26 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PHP code]]></category>
		<category><![CDATA[Wordpress plugin]]></category>
		<category><![CDATA[Amp]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Constructor]]></category>
		<category><![CDATA[Content Filter]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[Div Id]]></category>
		<category><![CDATA[Echo]]></category>
		<category><![CDATA[Filter Content]]></category>
		<category><![CDATA[Filter Function]]></category>
		<category><![CDATA[How To Make Wordpress Plugin]]></category>
		<category><![CDATA[Img]]></category>
		<category><![CDATA[Link Href]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Options]]></category>
		<category><![CDATA[Page Loads]]></category>
		<category><![CDATA[Phase 2]]></category>
		<category><![CDATA[Php Function]]></category>
		<category><![CDATA[Png]]></category>
		<category><![CDATA[Stylesheet]]></category>

		<guid isPermaLink="false">http://sourcecodemoney.com/?p=69</guid>
		<description><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		This article will present you with the basics of wordpress plugin. I have create a plugin to help you understand how to create a plugin. This simple plugin shows a digg button to all your post. You can download the full code here. Below is several code I use: class diggme { function diggme() { [...]]]></description>
			<content:encoded><![CDATA[		<link href="http://sourcecodemoney.com/wp-content/plugins/diggme/css.css" rel="stylesheet" type="text/css" />
		<div id="diggbutton"><a href="http://digg.com/submit?phase=2&amp;url=http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/"><img src="http://sourcecodemoney.com/wp-content/plugins/diggme/digg.png"></a></div><p>This article will present you with the basics of wordpress plugin. I have create a plugin to help you understand how to create a plugin. This simple plugin shows a digg button to all your post. You can download the full code <a href="http://sourcecodemoney.com/doc/diggme.zip">here</a>. Below is several code I use:</p>
<div id="code">
<p>class diggme<br />
{<br />
function diggme() {</p>
<p>add_action(&#8216;init&#8217;, array($this, &#8216;init&#8217;));<br />
add_action(&#8216;admin_menu&#8217;, array(&amp;$this, &#8216;setmenu&#8217;));<br />
add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;the_content_filter&#8217;));<br />
}</p>
<p>function init()<br />
{<br />
?&gt;<br />
&lt;link href=&#8221;&lt;?php echo get_option(&#8216;siteurl&#8217;); ?&gt;/wp-content/plugins/diggme/css.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;?php<br />
}</p>
<p>function managepage(){<br />
echo &#8220;&lt;div id=&#8217;setting&#8217;&gt;This is setting page. Just ignore this&lt;/div&gt;&#8221;;<br />
}</p>
<p>function setmenu () {<br />
add_options_page(<br />
&#8216;DiggMe&#8217;,<br />
&#8216;DiggMe&#8217;,<br />
&#8216;manage_options&#8217;,<br />
__FILE__,<br />
array(&amp;$this,&#8217;managepage&#8217; ) );<br />
}</p>
<p>function the_content_filter($content)<br />
{<br />
return $this-&gt;displaydigg() . $content;<br />
}</p>
<p>function displaydigg()<br />
{<br />
global $post;</p>
<p>return &#8220;&lt;div id=\&#8221;diggbutton\&#8221;&gt;&lt;a href=\&#8221;http://digg.com/submit?phase=2&amp;amp;url=&#8221;.get_permalink($post-&gt;ID).&#8221;\&#8221;&gt;&lt;img src=\&#8221;".get_settings(&#8216;siteurl&#8217;).&#8221;/wp-content/plugins/diggme/digg.png\&#8221;&gt;&lt;/a&gt;&lt;/div&gt;&#8221;;<br />
}</p>
<p>}</p>
<p>$diggme = new diggme();</p></div>
<ul>
<li>The code will first create a class called <strong><em>diggme</em></strong>. Every time the plugin loads it will create an object of this class using <em><strong>$diggme = new diggme();</strong></em></li>
</ul>
<p><strong>The constructor</strong></p>
<ul>
<li><em><strong>add_action(&#8216;init&#8217;, array($this, &#8216;init&#8217;));</strong></em> -&gt; This will tell your blog to execute function <em><strong>init </strong></em>whenever it loads.</li>
<li><em><strong>add_action(&#8216;admin_menu&#8217;, array(&amp;$this, &#8216;setmenu&#8217;));</strong></em> -&gt; This will tell your blog to create menu at your admin page. You can place any settings here.</li>
<li><em><strong>add_filter(&#8216;the_content&#8217;, array(&amp;$this, &#8216;the_content_filter&#8217;));</strong></em> -&gt; This will be executed every time when your post loads. In this example we will load function <em><strong>the_content_filter </strong></em>every time the page loads, read the post content and add a digg button to the post.</li>
</ul>
<p>Other function is easy to understand if you have basic PHP skill. If you have any question just comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://sourcecodemoney.com/how-to-make-wordpress-plugin-general/php-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

