<?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>matty.co.za &#187; Web Developer</title>
	<atom:link href="http://matty.co.za/tag/web-developer/feed/" rel="self" type="application/rss+xml" />
	<link>http://matty.co.za</link>
	<description>Web developer, WordPress enthusiast, avid musician, music lover and blogger</description>
	<lastBuildDate>Thu, 26 Jan 2012 18:06:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Filtering the Options API in WordPress</title>
		<link>http://matty.co.za/2012/01/filtering-wordpress-options-api/</link>
		<comments>http://matty.co.za/2012/01/filtering-wordpress-options-api/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 09:00:13 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1228</guid>
		<description><![CDATA[The Options API in WordPress is one of the many WordPress APIs we all use every day when developing with WordPress. A quick call to get_option() is not an uncommon sight. What if you could dynamically filter those options? You can. Adding filters in WordPress is also a common practice. Combining this with the Options [...]]]></description>
			<content:encoded><![CDATA[<p>The Options API in WordPress is one of the many WordPress APIs we all use every day when developing with WordPress. A quick call to get_option() is not an uncommon sight. What if you could dynamically filter those options? <strong>You can</strong>.</p>
<p>Adding filters in WordPress is also a common practice. Combining this with the Options API can allow for, for example, the ability to change an option when in preview mode without committing to the change.</p>
<p>In the &#8220;Magazine&#8221; template in Canvas by WooThemes, for example, WooTumblog &#8220;image&#8221; and &#8220;video&#8221; posts are aware when they are present in the magazine-style grid. This is an example of filtering the Options API.</p>
<p><span id="more-1228"></span><br />
<h3>How do I use this?</h3>
<p>Filtering the Options API is as easy as compiling any other filter. The filter hook is as follows: &#8220;<code>option_optionname</code>&#8221; (replace &#8220;<code>optionname</code>&#8221; with the name of the option you want to filter).</p>
<h3>That filter is applied after the database lookup. What about before that even happens?</h3>
<p>It is possible to short-circuit an option&#8217;s value using a second filter that has been made available. This means it&#8217;s possible to set a custom value, via a filter, for an option, bypassing the database lookup. My thoughts are packed with ideas for where to use this filter!</p>
<p>To short-circuit an option called, for example, &#8220;testoption&#8221;, you&#8217;d add the following code to your <code>functions.php</code> file:</p>
<p><code></p>
<pre>
add_filter( 'pre_option_testoption', 'matty_shortcircuit_options' );

function matty_shortcircuit_options ( $default ) {
	$value = 'this is a short-circuited option';
	return $value;
} // End matty_shortcircuit_options()
</pre>
<p></code></p>
<p>Using the &#8220;testoption&#8221; example again, this is how you&#8217;d override the value after it&#8217;s been retrieved from the database:</p>
<p><code></p>
<pre>
add_filter( 'option_testoption', 'matty_override_options' );

function matty_override_options ( $value ) {
	$value = 'this is an overridden option';

	// To override based on a condition, do this.
	if ( $value == 'test' ) {
		$value = 'this is an overridden option, based on a condition.';
	}

	return $value;
} // End matty_override_options()
</pre>
<p></code></p>
<p>This is just, however, a starting point as to how to do this. The possibilities are virtually limitless as to what is possible here and how to apply this in your projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/filtering-wordpress-options-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to improve web developer coding practices (and code)</title>
		<link>http://matty.co.za/2012/01/web-coding-best-practices/</link>
		<comments>http://matty.co.za/2012/01/web-coding-best-practices/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 18:44:15 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1223</guid>
		<description><![CDATA[Every developer approaches their day to day development tasks from a different angle. In addition to this, each developer &#8220;designs&#8221; their code to suit their own personal preferences and approaches towards specifics in a project. When developers examine code written by other developers, we&#8217;re often critical (sometimes hyper-critical) of the code itself, mostly according to [...]]]></description>
			<content:encoded><![CDATA[<p>Every developer approaches their day to day development tasks from a different angle. In addition to this, each developer &#8220;designs&#8221; their code to suit their own personal preferences and approaches towards specifics in a project. When developers examine code written by other developers, we&#8217;re often critical (sometimes hyper-critical) of the code itself, mostly according to our personal preferences. While there is a place for being critical of code, and it should be encouraged, there are a few aspects of this criticism that should be left at the door&#8230; namely, the personal preferences.</p>
<p>While we all have our own preferences, it&#8217;s important to solidify a few areas when approaching code and to, ultimately, hone the developer&#8217;s mindset into certain guidelines. Below are a few thoughts I have running through my mind constantly while developing:</p>
<p><span id="more-1223"></span><br />
<h3>1. Minimize lookups.</h3>
<p>This one is crucial when developing systems with heavy load. How many times are you hitting the database for information and how can you minimize that number? For example, when <a title="A Quick Guide to the WordPress Transients API" href="http://matty.co.za/2012/01/wordpress-transients-api/">using the Transients API in WordPress</a>, why would you run get_transient() again after you&#8217;ve just set the transient up? You&#8217;ve already got the data, so there&#8217;s no need.</p>
<h3>2. D.R.Y (don&#8217;t repeat yourself).</h3>
<p>This is a common development practice. Don&#8217;t repeat yourself. If you&#8217;ve got, for example, two functions that perform API requests, create a function that runs the API request with a few parameters to customise it in each case, rather than coding the request twice.</p>
<h3>3. One function, one purpose.</h3>
<p>This one helps me every day. It also ensures that your code is kept clean. If, for example, you have to display a collection of posts with specific criteria, why compile one function to do it all, when you could have a small function to get the data from the database and a second small function to output the data neatly? Surely that would make your code easier to read and maintain? Yep, it would. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>4. Do I need this function here?</h3>
<p>This one is about load and separation of code. Why load extra functions when you don&#8217;t need them in a specific context? Keeping this in mind ensures that you keep your code in &#8220;bite size chunks&#8221;, for example, splitting admin-related functions versus frontend functionality.</p>
<p>These items, while simple to adhere to, can alter the way a developer approaches a project, as well as creating a better end result. Most are also common development practices that most developers should be familiar with, making it easier for other developers to read and understand your projects.</p>
<p><em>Do you have any tips and tricks that help you day to day while developing?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/web-coding-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-thinking the concept of the &#8220;impossible&#8221;</title>
		<link>http://matty.co.za/2012/01/re-thinking-the-impossible/</link>
		<comments>http://matty.co.za/2012/01/re-thinking-the-impossible/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 17:00:14 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1213</guid>
		<description><![CDATA[In today&#8217;s society, it seems to be a common occurrence to use the word &#8220;impossible&#8221;. For example, after climbing a mountain, one might say something like; &#8220;wow, that was impossible&#8221;. No it wasn&#8217;t&#8230; you just did it. Nowadays we seem to have a tendency to over-exaggerate (pardon the tautology there) and, in many cases, start to believe what [...]]]></description>
			<content:encoded><![CDATA[<p>In today&#8217;s society, it seems to be a common occurrence to use the word &#8220;impossible&#8221;. For example, after climbing a mountain, one might say something like; &#8220;wow, that was impossible&#8221;. No it wasn&#8217;t&#8230; you just did it. Nowadays we seem to have a tendency to over-exaggerate (pardon the tautology there) and, in many cases, start to believe what we&#8217;re saying. Surely, this affects how we approach tasks and situations. Why should it?</p>
<p>Over the past few years (I&#8217;d say, since about 2008), I&#8217;ve decided to approach tasks day to day from a different angle. How can we say that a task is &#8220;impossible&#8221; if we haven&#8217;t even yet attempted it?</p>
<p>This is quite a common occurrence in web development&#8230; developers looking at a task, attempting to analyze it, getting &#8220;stuck&#8221; at one point and then moving on, deeming it &#8220;impossible&#8221;. Why does it have to, all of a sudden, be &#8220;impossible&#8221;, if you haven&#8217;t even attempted it yet? Why settle for the &#8220;shortcut&#8221; when you could just sit down and develop it how you envision it in the first place?</p>
<p><span id="more-1213"></span>It&#8217;s not about it being &#8220;impossible&#8221;&#8230; you just haven&#8217;t found the correct pieces yet, or how they fit together.</p>
<p>As a small example to illustrate how this approach sucks and how it could be improved with a simple re-thinking process, lets take a look at a real-world scenario I experienced last year.</p>
<p>During the development of our &#8220;Editorial&#8221; theme at WooThemes, we wanted to add functionality to provide the administrator with more control over how many columns their content should be laid out in. This, at first glance, seems quite straight forward. A simple PHP script to cut and re-arrange the words at certain points would do this.</p>
<p>What if the author wants to control where the content is cut off? What if they want virtually infinite possible columns? Well, a shortcode would do this, right?</p>
<p>What if they switch themes? Their content would look ugly and be riddled with a bunch of shortcodes that aren&#8217;t in use anymore. In a context like this, where the content is everything, we couldn&#8217;t have that.</p>
<p>This is where we got down to the drawing board and found the solution that stands to date. A simple button that adds an HTML comment into the author&#8217;s content. We then use a WordPress filter (and regular expression) to convert the HTML comments into semantic HTML tags on the frontend, keeping count of how many columns are being generated and adjusting the layout accordingly. If the administrator decides to switch themes, the HTML comments won&#8217;t affect the display of the content, nor the functionality of the WordPress admin. The button itself, as well as how the HTML comments are displayed in the WordPress admin, echoes how WordPress itself handles similar functionality, integrating seamlessly into the authoring experience.</p>
<p>To illustrate how this relates to the &#8220;impossible&#8221;, many would settle for the shortcode option, as it is the most direct and &#8220;obvious&#8221; choice, without taking into account the ramifications thereof.</p>
<p>We&#8217;ve taken this same approach on many other pieces of functionality within themes and functionality developed at WooThemes. I&#8217;ve made this concept a part of my day to day approach to things as well.</p>
<p>To sum it up in a sentence, I&#8217;d say, &#8220;don&#8217;t assume something is &#8216;impossible&#8217; until you&#8217;ve tried it. You never know&#8230; you may just get a better result&#8221;. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/re-thinking-the-impossible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GROW BootCamp 2012 &#8211; The Creations</title>
		<link>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/</link>
		<comments>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 14:00:13 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1204</guid>
		<description><![CDATA[At the GROW Academy 2012, Jeff and I have been discussing and showcasing WordPress and what it can do. We&#8217;ve been working with the recruits, setting up WordPress.com websites and learning the system. We thought it&#8217;d be a cool idea to showcase what the recruits of 2012 have compiled. Check out what the 2012 recruits [...]]]></description>
			<content:encoded><![CDATA[<p>At the GROW Academy 2012, Jeff and I have been discussing and showcasing WordPress and what it can do. We&#8217;ve been working with the recruits, setting up WordPress.com websites and learning the system.</p>
<p>We thought it&#8217;d be a cool idea to showcase what the recruits of 2012 have compiled.</p>
<p><span id="more-1204"></span>Check out what the 2012 recruits put together:</p>
<ul>
<li><a href="http://mtricam.wordpress.com/" target="_blank">mtricam</a></li>
<li><a href="http://genevievedavids.wordpress.com/" target="_blank">genevievedavids</a></li>
<li><a href="http://augustinemutale.wordpress.com/" target="_blank">augustinemutale</a></li>
<li><a href="http://margofortune.wordpress.com/" target="_blank">margofortune</a></li>
<li><a href="http://suzannesmith42.wordpress.com/" target="_blank">suzannesmith42</a></li>
<li><a href="http://justinejooste.wordpress.com/" target="_blank">justinejooste</a></li>
<li><a href="http://ricardoglittle.wordpress.com/" target="_blank">ricardoglittle</a></li>
<li><a href="http://thembil.wordpress.com/" target="_blank">thembil</a></li>
<li><a href="http://nathanieldicks.wordpress.com/" target="_blank">nathanieldicks</a></li>
<li><a href="http://gershwin21.wordpress.com/" target="_blank">gershwin21</a></li>
<li><a href="http://cyrilmphanga.wordpress.com/" target="_blank">cyrilmphanga</a></li>
</ul>
<p>Pretty cool, right? <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>These are the slides from yesterday&#8217;s presentation at the GROW Academy. Share your thoughts in the comments below.</p>
<p><iframe src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=427F49A6-F53B-3D2B-6078-C27F074A00C1" width="550" height="439" scrolling=no frameBorder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GROW Academy Bootcamp 2012</title>
		<link>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/</link>
		<comments>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:00:31 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1198</guid>
		<description><![CDATA[This week, Jeff and I will be presenting at our second GROW Academy Bootcamp session. We&#8217;ll be discussing &#8220;Website Design &#38; Development&#8221; with the recruits, running through WordPress and how to setup a website using WordPress.com or WordPress.org. The GROW Academy is an initiative to educate and empower the youth of today through technology. The [...]]]></description>
			<content:encoded><![CDATA[<p>This week, <a title="Jeffikus" href="http://jeffikus.com/">Jeff</a> and I will be presenting at our second GROW Academy Bootcamp session. We&#8217;ll be discussing &#8220;Website Design &amp; Development&#8221; with the recruits, running through WordPress and how to setup a website using WordPress.com or WordPress.org.</p>
<p>The <a title="The GROW Academy" href="http://grow.org.za/">GROW Academy</a> is an initiative to educate and empower the youth of today through technology. The Bootcamp session covers everything from social media and setting up e-mail, all the way through to search engine optimisation and an internet super-user course, for those who wish to continue on with more advanced studies. The GROW website&#8217;s &#8220;<a title="About GROW" href="http://grow.org.za/about/">About</a>&#8221; page (built on Canvas and Canvas BuddyPress by WooThemes) has a detailed explanation of the initiative and it&#8217;s founding partners.</p>
<p><span id="more-1198"></span>This year, Jeff and I will be making some exciting additions to our presentation. While code, to some, can seem dry and boring, I can assure you that there&#8217;s nothing dry or boring about our presentation. We had such a blast at last year&#8217;s Bootcamp and are really looking forward to getting into some code with this year&#8217;s recruits.</p>
<p>If you&#8217;re keen to get involved with GROW, I&#8217;d encourage you to contact the GROW Academy and see how you can help out.</p>
<p>Remember: it&#8217;s all easy, and there&#8217;s no such thing as a stupid question. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Guide to the WordPress Transients API</title>
		<link>http://matty.co.za/2012/01/wordpress-transients-api/</link>
		<comments>http://matty.co.za/2012/01/wordpress-transients-api/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 08:00:38 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1168</guid>
		<description><![CDATA[The Transient API in WordPress is one of the many APIs available in the WordPress core that, once used, become invaluable and used on a daily basis. This is a quick guide to getting started with the transients API, when to use it and why. The Transients API, while similar to the WordPress options API, [...]]]></description>
			<content:encoded><![CDATA[<p>The Transient API in WordPress is one of the many APIs available in the WordPress core that, once used, become invaluable and used on a daily basis. This is a quick guide to getting started with the transients API, when to use it and why.</p>
<p>The Transients API, while similar to the WordPress options API, has the addition of an expiry time. The API is used to store data in the database for a fix amount of time, at which point it is deleted and would need to be re-added, if one requires the data again. The WordPress Codex explains the <a href="http://codex.wordpress.org/Transients_API" title="The Transients API documentation on the WordPress Codex">Transients API</a> as:</p>
<blockquote><p>…very similar to the Options API but with the added feature of an expiration time, which simplifies the process of using the wp_options database table to store cached information.</p></blockquote>
<p>From a technical standpoint, transients are also sped up by caching plugins, which store the data in memory, rather than in the database, making for a faster lookup.</p>
<p><span id="more-1168"></span><br />
<h3>Getting started</h3>
<p>Using transients is easier than you might think. The first thing to note is that there are two types of transients; conventional (only on the specified site within a WordPress multisite installation) and &#8220;site&#8221; (across the entire WordPress multisite installation). They interact in the same way though.</p>
<p>The Transients API has 3 core functions; <code>set_transient()</code>, <code>get_transient()</code> and <code>delete_transient()</code>. They function in the same way as <code>add_option()</code>, <code>get_option()</code> and <code>delete_option()</code> do, so they should be familiar.</p>
<h3>Brief function analysis</h3>
<h4>set_transient()</h4>
<p>Stores data in a transient.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient to store the data in)</li>
<li>The value (the data to store)</li>
<li>The expiration (the time expiration, in seconds, from the time of storage &#8211; one day would be 60 * 60 * 24)</li>
</ol>
<h4>get_transient()</h4>
<p>Retrieve the transient data, if it&#8217;s available.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient the data is stored in)</li>
</ol>
<h4>delete_transient()</h4>
<p>Force the expiry/removal of a specified transient.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient the data is stored in)</li>
</ol>
<h3>The Transients API in use</h3>
<p>To use the Transients API, the process is straight forward. Check if the transient is available. If it isn&#8217;t, get the data (this could be anything from a simple line of text -which may not be too practical- to an advanced and resource-intensive database query, which you may not want to run every time your website is loaded) and assign it to the transient. Assign the data to a variable and return it for use in your code.</p>
<p>In code, this may look like the following:</p>
<p><code></p>
<pre>
&lt;?php
	$transient_key = 'my-transient-key';
	$data = get_transient( $transient_key );
	if ( $data == '' ) {
		$data = get_posts( array( 'posts_per_page' => -1 ) );
		set_transient( $transient_key, $data, 60 * 60 * 24 );
	}

	// You would then carry on using $data in your code.
?&gt;
</pre>
<p></code></p>
<p>An example of when WordPress itself uses the Transients API is during checks for updates of themes, plugins and WordPress itself. These checks don&#8217;t in fact happen each time you visit the &#8220;Updates&#8221; dashboard screen, but periodically based on a transient of stored information about the themes and plugins you have in your installation.</p>
<h3>Where and when to use the Transients API</h3>
<p>Usage of this API is vast and varied. Essentially, the Transients API can be seen as a form of caching system with an expiry time. Therefore, you may want to cache data (for example, from an RSS feed or API request) for a few hours or days, or you could cache something for a few seconds while a user is busy on your website (to make their experience that little bit faster). With such simple implementation, the usage possibilities are limited only by one&#8217;s imagination and a coding project&#8217;s requirements.</p>
<p>Now that you know about the Transients API, I&#8217;m certain you&#8217;ll start using it more often to speed up your projects. This API, while seemingly so small and simple, is incredibly powerful and can transform bloated code into streamlined genius.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/wordpress-transients-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Re-thinking &#8220;Uncategorized&#8221; in WordPress</title>
		<link>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/</link>
		<comments>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:00:30 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Support]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1158</guid>
		<description><![CDATA[As WordPress users soon come to realise after setting up their website, a few defaults are loaded in. These defaults include a test &#8220;Hello World&#8221; post with a comment from Mr. WordPress, a &#8220;Sample Page&#8217; with some text and instructions and the &#8220;Uncategorized&#8221; category, amongst the various default &#8220;Links&#8221; data and &#8220;Blogroll&#8221; category. Having given [...]]]></description>
			<content:encoded><![CDATA[<p>As WordPress users soon come to realise after setting up their website, a few defaults are loaded in. These defaults include a test &#8220;Hello World&#8221; post with a comment from Mr. WordPress, a &#8220;Sample Page&#8217; with some text and instructions and the &#8220;Uncategorized&#8221; category, amongst the various default &#8220;Links&#8221; data and &#8220;Blogroll&#8221; category.</p>
<p>Having given this some thought, the &#8220;Uncategorized&#8221; category doesn&#8217;t really seem correct in that the term is a category in itself. It&#8217;s almost a full paradox to say that a post is &#8220;uncategorized&#8221;, meanwhile it is in fact in a category.</p>
<p><span id="more-1158"></span></p>
<p>Upon removing the relationship entirely between the &#8220;Uncategorized&#8221; category and a specific post, the post worked as expected with no issues. By default, a post is assigned to the category set as the default category in the WordPress settings screens within the WordPress admin. Therefore, while it is possible to assign a new default category and delete the &#8220;Uncategorized&#8221; category, the question is more, <strong>why do posts in WordPress need to be assigned to a specific category?</strong> Can they not just float independently?</p>
<p>I&#8217;m sure there&#8217;s a reason behind this (if you know it or can offer some insight into possible reasons, please share)&#8230; just thought I&#8217;d pose the thought and see what you all think. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What a blog redesign means to me</title>
		<link>http://matty.co.za/2011/07/what-a-blog-redesign-means-to-me/</link>
		<comments>http://matty.co.za/2011/07/what-a-blog-redesign-means-to-me/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 10:48:42 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Theming]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1119</guid>
		<description><![CDATA[Today&#8217;s question, folks, is; &#8220;What does a blog redesign mean to you?&#8221;. Lets dive right in, shall we? For me, a blog redesign means quite a lot. It means the opportunity to hone my skills, experiment with new ideas and techniques and put a fresh coat of paint and a new engine behind my blog. [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s question, folks, is; &#8220;What does a blog redesign mean to you?&#8221;. Lets dive right in, shall we?</p>
<p>For me, a blog redesign means quite a lot. It means the opportunity to hone my skills, experiment with new ideas and techniques and put a fresh coat of paint and a new engine behind my blog. Let me elaborate on the paint and engine for a moment.</p>
<p><span id="more-1119"></span><br />
Over the past few months, I&#8217;ve designed and developed at least 3 new themes for this blog. By the time I reach what looks like the end of the theme, I&#8217;ve become bored with the design or feel the code is now &#8220;old&#8221; and would prefer to start again on a new design idea I&#8217;ve come across while scouting around online for inspiration. This has proven to be a vicious cycle whereby the ultimate goal is never achieved: a new blog design.</p>
<h3>Why not just get someone else to do it?</h3>
<p>It comes down to personal preference on this one. I&#8217;m a professional web developer and am trained and qualified as a designer, so why not design and develop the theme myself? In addition, am I not letting an opportunity to show my abilities get put aside? In addition, at the end of the day, I can say that I designed and developed the entire theme from the ground up, which makes the achievement that much sweeter.</p>
<h3>The search for perfection?</h3>
<p>Designers often run into this, from what I&#8217;ve seen. There&#8217;s always something that can be done to improve a design further. Pixels can be shifted around until blue in the face… but will it ever be finished? The same goes for development. That one line of code can be optimised, written and re-written over and over until it becomes almost meaningless. Does it really improve or contribute anything?</p>
<p>Yes, it does. Does it have to be done right this very second, though? If it&#8217;s not a life-changing development decision, or an integral part of the design, probably not. Having the code as optimised as possible is great… but if no-one sees it, what good is it doing?</p>
<h3>Final words&#8230;</h3>
<p>With that said, I&#8217;ve come to a new conclusion (and am writing it in this post for posterity): a blog&#8217;s design is never truly &#8220;finished&#8221;. With the web evolving at the rate it is, it makes perfect sense to revamp your web presence every few months… kind of like putting a fresh coat of paint on a house. Therefore, I&#8217;ve published this redesign as is and will continue to work on it and make improvements. That way, the design and development will remain constantly fresh, and I&#8217;ll be able to hone my skills and experiment on things on a more regular basis, rather than tying that down into a phase of &#8220;I am now redesigning my blog, therefore, let me experiment&#8221;.</p>
<p>If you spot anything that could do with some more cowbell, give me a shout and I&#8217;ll get right on it. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2011/07/what-a-blog-redesign-means-to-me/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A theory on approaching difficult tasks</title>
		<link>http://matty.co.za/2009/11/approaching-difficult-tasks/</link>
		<comments>http://matty.co.za/2009/11/approaching-difficult-tasks/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 18:09:17 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=729</guid>
		<description><![CDATA[Whichever industry you work in, whether you work for yourself or a company and whatever your job description, there are days where things just aren&#8217;t going your way. No matter how long you sit at your desk, tapping your pencil, the solution to the problem at hand just isn&#8217;t apparent. As a developer, the problem [...]]]></description>
			<content:encoded><![CDATA[<p>Whichever industry you work in, whether you work for yourself or a company and whatever your job description, there are days where things just aren&#8217;t going your way. No matter how long you sit at your desk, tapping your pencil, the solution to the problem at hand just isn&#8217;t apparent.</p>
<p>As a developer, the problem and solution are usually quite clean-cut (such is the nature of code, prodominantly). The solution, however clean-cut it may be, isn&#8217;t always visible when approaching a coding task. At times like those, I employ a theory:<br />
<span id="more-729"></span></p>
<blockquote><p>Whatever you do to figure out the solution, whatever pencil-tapping or repeated contact between your head and desk occurs, the end result will work and be exactly as per the task set out to you.</p></blockquote>
<p>Knowing this, the task of achieving the goal becomes seemingly less stressful and a bit clearer to tackle. In addition, I find it important to clear one&#8217;s head, move away from the problem for a few minutes and give it some thought from a different angle.</p>
<p>That&#8217;s my theory, anyways.</p>
<p>Stop. Think. Re-evaluate.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2009/11/approaching-difficult-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A few guidelines for WordPress plugin development</title>
		<link>http://matty.co.za/2009/06/guidelines-for-wordpress-plugin-development/</link>
		<comments>http://matty.co.za/2009/06/guidelines-for-wordpress-plugin-development/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:12:02 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=510</guid>
		<description><![CDATA[The WordPress plugin API is vast and powerful. It allows developers to essentially hook code into almost any area of the WordPress system without modifying the core files at all. It also allows for the creation of standalone plugins that work within the WordPress system but do not hook into the core modules. Over the [...]]]></description>
			<content:encoded><![CDATA[<p>The WordPress plugin API is vast and powerful. It allows developers to essentially hook code into almost any area of the WordPress system without modifying the core files at all. It also allows for the creation of standalone plugins that work within the WordPress system but do not hook into the core modules.</p>
<p>Over the last few weeks, WordPress plugin development has become one of my favourite things to do. I find it exciting to be able to create functionality, incorporate it seemlessly into the WordPress system and see it work smoothly with the other modules. While plugin development for WordPress is incredibly powerful, it also carries with it a few areas where people commonly stumble over and potentially lose interest in their code&#8230; which could be the next big thing. Here are a few guidelines I&#8217;ve picked up in order to step over the stumbling blocks.<br />
<span id="more-510"></span></p>
<h3>1. Understand actions, filters and hooks, where to use which action and their limitations.</h3>
<p><a title="Wordpress Actions Reference" href="http://codex.wordpress.org/Plugin_API/Action_Reference" target="_blank">Actions, filters and hooks</a> are what allow developers to insert their code into virtually any part of the WordPress system. While there are only almost 400 hooks documented, there are in fact around 800 hooks in the WordPress system. The WordPress codex has a great reference for actions, filters, hooks and how to use them.</p>
<h3>2. <code>register_activation_hook()</code> does not function the same way as <code>add_action()</code>.</h3>
<p>While looking through the WordPress forums, the <code>register_activation_hook()</code> function (runs the function you pass to it when the plugin is activated) has come up as a regular topic of conversation. Users are attempting to display text on activation, using it as if it were the add_action() function. register_activation_hook() does not function the same way. The function, the way I understand it, works in an almost overall scope, not having access to variables within your plugin for display purposes. In short, don&#8217;t try to echo or print variables with this function. It won&#8217;t work. The function is best used for doing common setup such as installing database tables, setting default options, etc.</p>
<h3>3. Use <code>dbDelta</code> instead of <code>mysql_query</code> or <code>$wpdb-&gt;query()</code> when installing database tables.</h3>
<p>The dbDelta function (which you pass your database query to) is used when installing tables into your WordPress database. It is also used as an upgrade script in the same area. Don&#8217;t forget to include the WordPress upgrade script before running <code>dbDelta()</code>. The include looks like this:</p>
<p><code>require_once(ABSPATH . 'wp-admin/includes/upgrade.php');</code></p>
<h3>4. Understand the scope of your plugin and work within it.</h3>
<p>As mentioned above, WordPress plugins can be used to hook into essentially any area of the WordPress system. This includes standalone menus, as well as running actions when a post or page is saved, for example. Understanding the objective/s and scope of one&#8217;s WordPress plugin is essential to choosing the correct approach for the plugin. If it&#8217;s a short plugin with specific objective, there&#8217;s no need, in my opinion, for more than one or two files. Keep it simple. On the other hand, if the plugin is a large, standalone module, I don&#8217;t believe there&#8217;s any reason to have cluttered files of hundreds of lines of code, where an Object Oriented approach would ultimately serve as a much cleaner and more extendable solution.</p>
<h3>5. Plan, plan, plan.</h3>
<p>Planning on paper, drafting a code map on screen, talking it through with other developers. Planning a plugin can never be done too much. It helps with all of the above steps as well as helping to see where you need to be at the end of the development and planning a solid roadmap for the journey to get there. Also, other users may have ideas that could streamline your plugin even further.</p>
<p>These are just a few things I&#8217;ve picked up on my WordPress plugin development journey. I&#8217;ll post more if and when they come up. I hope these tips are useful and help in overcoming the potential stumbling blocks when getting started with WordPress plugin development.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2009/06/guidelines-for-wordpress-plugin-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 639/769 objects using disk: basic

Served from: matty.co.za @ 2012-02-05 07:28:19 -->
