<?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/" version="2.0">

<channel>
	<title>Tom McFarlin</title>
	
	<link>http://tommcfarlin.com</link>
	<description>Articles, Projects, and Resources For Professional WordPress Development</description>
	<lastBuildDate>Mon, 17 Jun 2013 22:03:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/tommcfarlin" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="tommcfarlin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">tommcfarlin</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>All About The Trailing Slash in WordPress</title>
		<link>http://tommcfarlin.com/trailing-slash-in-wordpress/</link>
		<comments>http://tommcfarlin.com/trailing-slash-in-wordpress/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 12:30:45 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11646</guid>
		<description><![CDATA[<p>Last week, I wrote a post discussing why I think it&#8217;s important to use a trailing slash in WordPress. The point of the post was to state that when you&#8217;re working with URLs and you&#8217;re looking for the last index of the array, the only way to guarantee the it&#8217;s always at the final position is [...]</p><p><a href="http://tommcfarlin.com/trailing-slash-in-wordpress/">All About The Trailing Slash in WordPress</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>Last week, I wrote a post discussing why I think it&#8217;s important to <a title="Trailingslashit in WordPress" href="http://tommcfarlin.com/trailingslashit-in-wordpress/">use a trailing slash in WordPress</a>.</p>
<p>The point of the post was to state that when you&#8217;re working with URLs and you&#8217;re looking for the last index of the array, the only way to guarantee the it&#8217;s <em>always</em> at the final position is if there&#8217;s a trailing slash so that you can <code><a title="PHP Explode" href="http://php.net/manual/en/function.explode.php">explode</a></code> on the &#8216;/&#8217; character.</p>
<p>This post lead to some good discussion about why or why not to use <code><a title="WordPress' trailingslashit function" href="http://codex.wordpress.org/Function_Reference/trailingslashit" target="_blank">trailingslashit</a></code>, it brought to light to some other important and useful functions, and actually reminded me that there are times when trailing slashes should be used and when they shouldn&#8217;t.</p>
<p>To that end, I thought I&#8217;d thought I&#8217;d do a more thorough explanation as to each of the &#8220;trailing slash&#8221; functions WordPress offers, their purpose, and why trailing slashes are even important in the context of URLs.</p>
<p><span id="more-11646"></span></p>
<h2>The Trailing Slash in WordPress</h2>
<p>As I mentioned earlier, using the trailing slash in WordPress is something that can provide benefits especially when it comes to locating the last index of the array.</p>
<p>The thing is, there are actually three different functions (at least, that I&#8217;m awareof) that deal with trailing slashes. On top of that, there&#8217;s a time and a place when when should include a trailing slash and when we shouldn&#8217;t.</p>
<h3>When should we use a trailing slash in WordPress?</h3>
<p>This is actually a question that can be more generalized that <em>just</em> WordPress. In fact, you could simply ask: &#8220;when should be use a trailing slash.&#8221;</p>
<p>The short answer is this:</p>
<ul>
<li>If your anchor is linking to a <em>directory</em>, then use a trailing slash.</li>
<li>If it&#8217;s linking to a <em>file</em>, do not use a trailing slash.</li>
</ul>
<p>Easy enough, right?</p>
<p>To that end, there&#8217;s actually more reading on this if you&#8217;re interested in the technical reasons for this. First, <a title="To Slash or Not To Slash" href="http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html" target="_blank">the Google Webmasters blog</a> provides a good, short article on the topic. Secondly, <a title="Uniform resource identifier - Wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier" target="_blank">the Wikipedia article on URI&#8217;s</a> &#8211; or uniform resource identifiers &#8211; provides a much more technical piece on URL structures.</p>
<h3>How do we remove a trailing slash in WordPress?</h3>
<p>Before answering this question, I want to give <a title="Comments on Trailingslashit in WordPress" href="http://tommcfarlin.com/trailingslashit-in-wordpress/#comment-218054" target="_blank">Antonio</a> props for bringing up this alternative scenario in the comments of the previous post.</p>
<div id="attachment_11670" class="wp-caption aligncenter" style="width: 620px"><img class="size-large wp-image-11670" alt="untrailingslashit in WordPress" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-17-at-8.18.45-AM-1024x864.png" width="610" height="514" /><p class="wp-caption-text"><a href="http://codex.wordpress.org/Function_Reference/untrailingslashit">untrailingslashit</a> in WordPress</p></div>
<p>In short, if you&#8217;re looking to guarantee that you will not have a trailing slash on the URL using the WordPress API, then take advantage of the <code><a title="Untrailingslashit" href="http://codex.wordpress.org/Function_Reference/untrailingslashit" target="_blank">untrailingslashit</a></code> function.</p>
<p>Just as the Codex mentions:</p>
<blockquote><p>Removes trailing slash if it exists.</p></blockquote>
<p>But that&#8217;s not all. There&#8217;s a short note that the Codex also states that should be recognized:</p>
<blockquote><p>The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.</p></blockquote>
<p>This means that if you&#8217;re trying to follow the best practices of using a slash for directories and no slashes for files, then using this function could have unintended consequences. Namely, it will remove the trailing slash from <em>all </em>URL&#8217;s that it&#8217;s given.</p>
<h3>And how do we add a trailing slash in WordPress?</h3>
<p><a title="Trailing Slashes in WordPress" href="http://tommcfarlin.com/trailingslashit-in-wordpress/" target="_blank">I covered this last week</a>, but in order to be complete, I thought it may be worth summarizing again here in this post.</p>
<p>Simply put, if you&#8217;re looking to guarantee that you <em>do</em> have a slash at the end of the URL, then checkout the <code><a title="Trailing Slashes in WordPress" href="http://codex.wordpress.org/Function_Reference/trailingslashit" target="_blank">trailingslashit</a></code> function in the WordPress API.</p>
<div id="attachment_11666" class="wp-caption aligncenter" style="width: 620px"><img class="size-large wp-image-11666" alt="trailingslash it in WordPress" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-17-at-8.18.37-AM-1024x815.png" width="610" height="485" /><p class="wp-caption-text"><a href="http://codex.wordpress.org/Function_Reference/trailingslashit">trailingslashit</a> in WordPress</p></div>
<p>Practically speaking, this is the inverse of <code>untrailingslashit</code>. First, just as the Codex mentions:</p>
<blockquote><p>Appends a trailing slash.</p></blockquote>
<p>It also provides the same note that it&#8217;s inverse function offers:</p>
<blockquote><p>The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.</p></blockquote>
<p>For those of you who are curious, <code>trailingslashit</code> actually <em>uses</em> <code>untrailingslashit</code> to remove any trailing slashes before adding a new one.</p>
<h3>What is user_trailingslashit?</h3>
<p><code>user_trailingslashit</code> is an API function that WordPress provides that makes sure that the format of a given URL matches the settings that the user has configured in their settings.</p>
<p>At the time of this writing, I could not find a Codex article about this particular function; however, the code comments offer the following:</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Retrieve trailing slash string, if blog set for adding trailing slashes.
 *
 * Conditionally adds a trailing slash if the permalink structure has a trailing
 * slash, strips the trailing slash if not. The string is passed through the
 * 'user_trailingslashit' filter. Will remove trailing slash from string, if
 * blog is not set to have them.
 *
 * @since 2.2.0
 * @uses $wp_rewrite
 *
 * @param string $string URL with or without a trailing slash.
 * @param string $type_of_url The type of URL being considered (e.g. single, category, etc) for use in the filter.
 * @return string
 */
</pre>
<p>I&#8217;ve personally had to use this function when working on <a title="Standard Theme" href="http://standardtheme.com/" target="_blank">Standard</a> and documented the reasons why <a title="Understanding user_trailingslashit" href="http://tommcfarlin.com/user_trailingslashit/" target="_blank">in this post</a>.</p>
<p>This particular function, although useful, is one that requires a bit of care as you need to really understand the path to which you&#8217;re linking and whether or not it should have a trailing slash or not.</p>
<p>Once you&#8217;ve determined that, prepare the URL <em>then</em> send it to this function. That should yield the best results.</p>
<h2>A Summary of The Trailing Slash in WordPress</h2>
<p>Dealing with trailing slashes isn&#8217;t so much complicated as it is knowing what you&#8217;re linking to and what the best practices for each scenario are.</p>
<p>Once you understand that, I think understanding exactly what functions to use makes sense &#8211; in fact, each one lends itself to the proper scenario:</p>
<ul>
<li><span style="line-height: 13px">If you&#8217;re linking to a file, use <code>untrailingslashit</code>.</span></li>
<li>If you&#8217;re linking to a path, use <code>trailingslashit</code>.</li>
<li>If you&#8217;re looking to leverage the user&#8217;s settings, use <code>user_trailingslashit</code> but only after one of the above functions has processed the URL.</li>
</ul>
<p>Hopefully, this post clarifies some issues around trailing slashes in WordPress, how to use, how to abuse, and how to mitigate whatever other crazy situations we end find ourselves in when working on projects.</p><p><a href="http://tommcfarlin.com/trailing-slash-in-wordpress/">All About The Trailing Slash in WordPress</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/trailing-slash-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using trailingslashit in WordPress</title>
		<link>http://tommcfarlin.com/trailingslashit-in-wordpress/</link>
		<comments>http://tommcfarlin.com/trailingslashit-in-wordpress/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 11:53:57 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11554</guid>
		<description><![CDATA[<p>When it comes to working with URLs, I believe that we should often be using trailingslashit in WordPress. This is post is part of a larger discussion that I&#8217;ll be covering in more detail in another post, but here&#8217;s the gist of why I&#8217;m a fan of using trailingslashit. Here&#8217;s why: there&#8217;s only a handful of [...]</p><p><a href="http://tommcfarlin.com/trailingslashit-in-wordpress/">Using trailingslashit in WordPress</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>When it comes to working with URLs, I believe that we should often be using <code><a title="trailingslashit" href="http://codex.wordpress.org/Function_Reference/trailingslashit" target="_blank">trailingslashit</a></code> in WordPress.</p>
<p>This is post is part of a larger discussion that I&#8217;ll be covering in more detail in another post, but here&#8217;s the gist of why I&#8217;m a fan of using <code>trailingslashit</code>.</p>
<p>Here&#8217;s why: there&#8217;s only a handful of operations that you can really be doing:</p>
<ul>
<li><span style="line-height: 13px">Setting up some type of rewrite rules or routes</span></li>
<li>Sniffing out parts of the URL to check for data</li>
<li>Redirecting (or protecting) users from content based on their status</li>
<li>&#8230;and maybe a few more</li>
</ul>
<p>When it comes to examining the contents of the URL, one of the most common &#8211; if not <em>the</em> most common &#8211; way of doing it is using <code><a title="explode" href="http://php.net/manual/en/function.explode.php" target="_blank">explode</a></code> and then examine the various indexes of the array.</p>
<p>But in order to properly handle this, I think that we have an obligation to code defensively against URLs because we never know how users, third party libraries, or other clients are going to provide said URL.</p>
<p>And thus the case for <em>always</em> using <code>trailingslashit</code> in WordPress projects.</p>
<p><span id="more-11554"></span></p>
<h2>trailingslashit in WordPress</h2>
<p>Simply put, <code>trailingslashit</code> will append a backslash to the end of a URL that&#8217;s passed as its parameter. If one already exists, then it won&#8217;t duplicate the existing trailing slash.</p>
<p><img class="aligncenter size-large wp-image-11558" alt="trailingslashit in WordPress" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-14-at-7.29.24-AM-1024x855.png" width="610" height="509" /></p>
<p>But the reasons for doing this aren&#8217;t arbitrary &#8211; it makes managing, parsing, and examining URL&#8217;s much easier, and here&#8217;s why:</p>
<p>Whenever you implement a trailing slash at the end of a URL, you are giving a definitive end point to your URL such that calling <code>explode</code> on a URL will allow you to have a fixed set of array indexes that contain each component.</p>
<p>Without having a trailing slash, you may end up running into an undefined index. <a title="Antonio on Comments" href="http://tommcfarlin.com/trailingslashit-in-wordpress/#comment-218054">Antonio</a> offers a second opinion, which is completely viable, and which I&#8217;ll be discussing in the next post, too.</p>
<p>Consider this: Let&#8217;s say that you&#8217;re expecting a value to be at the last index of the array. If the trailing slash is present, then the value at the end of the array will always be two-off from the end; otherwise, it will be one-off from the end.<span style="font-family: Monaco, 'Andale Mono', 'Courier New', monospace;font-size: 12px"><br />
</span></p>
<p>If the input is variable, then there&#8217;s no way to know which index to check. By applying <code>trailingslashit</code>, you can ensure the value for which you&#8217;re looking is always at the same index.</p>
<pre class="brush: php; title: ; notranslate">
$arr_example = explode( '/', trailingslashit( $url ) );
$value = $arr_example[ count( $arr_example ) - 2 ];
</pre>
<p>Without using <code>trailingslashit</code>, you have no way of knowing if this index will actually exist at the end of the array or one index away from the end of the array, whereas using it will prevent that very problem from occurring.</p>
<p>Although there are multiple applications for this function, this is a safe guard when it comes to inspecting the last component of a URL.</p>
<p>That said, this isn&#8217;t <em>the</em> definitive way to go about handling trailing slashes. It&#8217;s a good way, but there&#8217;s another use case to consider. Thanks to thoughts <a title="Comments" href="http://tommcfarlin.com/trailingslashit-in-wordpress#comments">by several commenters</a>, I&#8217;ll be covering the flip side of this in the next post.</p><p><a href="http://tommcfarlin.com/trailingslashit-in-wordpress/">Using trailingslashit in WordPress</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/trailingslashit-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>My First Post on Medium: “It’s So Hard To Find Good Help These Days”</title>
		<link>http://tommcfarlin.com/post-on-medium/</link>
		<comments>http://tommcfarlin.com/post-on-medium/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 10:57:41 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Medium]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11394</guid>
		<description><![CDATA[<p>If you're interested in tracking all of my posts on Medium, be sure to bookmark this link.This week, I ended up writing my first post on Medium and, as promised, thought I&#8217;d share my thoughts on my initial experience. Ah, an in case you&#8217;re a drive-by reader, last week, I shared that I had received [...]</p><p><a href="http://tommcfarlin.com/post-on-medium/">My First Post on Medium: &#8220;It&#8217;s So Hard To Find Good Help These Days&#8221;</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p style="background-color:#fcf8e3;border:1px solid #fbeed5;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;margin-bottom:18px;margin:8px 0 8px 0;color:#c09853;padding:12px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);font-family:Arial,Sans-serif;font-size:12px;" class="single-post-message">If you're interested in tracking all of my posts on Medium, be sure to bookmark <a href="https://medium.com/@tommcfarlin">this link</a>.</p><!-- /.single-post-message --><p>This week, I ended up writing my first post on Medium and, as promised, thought I&#8217;d share my thoughts on my initial experience.</p>
<p>Ah, an in case you&#8217;re a drive-by reader, last week, I shared that I had received an invitation to Medium and shared a few of my thoughts on <a title="Writing on Medium" href="http://tommcfarlin.com/writing-on-medium/">the tension of writing on the platform</a>. So the purpose of this post is to revisit my thoughts from <em>that</em> post, and share about my experience thus far.</p>
<p>At this point, with a single post, there&#8217;s not <em>much</em> to say, but here&#8217;s what I have to offer.<br />
<span id="more-11394"></span></p>
<h2>My Post on Medium: This Post on That Post</h2>
<p><img class="aligncenter size-large wp-image-11398" alt="First Post on Medium" src="http://tommcfarlin.com/files/2013/06/first-post-on-medium-1024x727.png" width="610" height="433" /></p>
<p>First off, what motivated me to post on Medium &#8211; aside from simply wanting to try the service &#8211; was that I had content that I felt was worth sharing, but didn&#8217;t exactly fit in the context of this blog, or any of the other ones to which I contribute.</p>
<p>Secondly, the content ownership issue is one that I have to get over, but Medium makes this really easy:</p>
<ul>
<li><span style="line-height: 13px">I can link to the original post from this post and be good to go</span></li>
<li>I can download my content from Medium at any time</li>
<li>If I <em>really</em> want to own the content, I&#8217;ll just save it in a text file and store it in Dropbox</li>
</ul>
<p>So with that said, here&#8217;s a post-mortem of sorts.</p>
<h3>First Post!</h3>
<p>As mentioned, the whole idea behind posting on Medium was sharing content that I didn&#8217;t feel really belong on this site or any of the others to which I contributed.</p>
<p>Specifically, the article is titled <i>&#8220;<a title="It's So Hard To Find Good Help These Days" href="https://medium.com/what-im-learning-building-a-company/ff27d257e99e" target="_blank">It&#8217;s So Hard To Find Good Help These Days</a>&#8220; </i>and generally captures some of the struggles of what it&#8217;s been like to find and hire (or not) others to help grow a company.</p>
<h3>A Place For Everything</h3>
<p>One of the things that helped inspire this particular post was a conversation I had with <a title="John Saddington" href="http://twitter.com/saddington/" target="_blank">John</a> a week or so ago. And when I noticed that Medium offers Collections for your posts, I created a collection <em>What I&#8217;m Learning Building a Company </em>and dropped the post in there.</p>
<p>Overtime, we&#8217;ll see if I continue to contribute to the collection.</p>
<h3>A Medium Experience</h3>
<p>Above all else, I <em>really</em> enjoyed the process of writing on Medium. Being able to see <em>exactly</em> what your post is going to look like as soon as you hit publish is nice.</p>
<p>There&#8217;s no toggling between browser tabs to make sure things look the way they should.</p>
<p>Additionally, the fact that there&#8217;s a single theme and set of typography takes all of the overhead out from thinking about &#8220;how should I present this?&#8221; or &#8220;do I want this there, or there?&#8221; It just is. And I like that.</p>
<p>Anyway, as I said, we&#8217;ll see if I continue to contribute to the collection, but for now you can read <a title="What I'm Learning Building a Company" href="https://medium.com/what-im-learning-building-a-company" target="_blank">other posts that people have contributed</a> to said collection.</p><p><a href="http://tommcfarlin.com/post-on-medium/">My First Post on Medium: &#8220;It&#8217;s So Hard To Find Good Help These Days&#8221;</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/post-on-medium/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Easily Filter Names in jQuery</title>
		<link>http://tommcfarlin.com/filter-names-in-jquery/</link>
		<comments>http://tommcfarlin.com/filter-names-in-jquery/#comments</comments>
		<pubDate>Thu, 13 Jun 2013 13:22:25 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11490</guid>
		<description><![CDATA[<p>If you're an advanced developer or just want the TL;DR version of this,</p><p><a href="http://tommcfarlin.com/filter-names-in-jquery/">How To Easily Filter Names in jQuery</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p style="background-color:#fcf8e3;border:1px solid #fbeed5;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;margin-bottom:18px;margin:8px 0 8px 0;color:#c09853;padding:12px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);font-family:Arial,Sans-serif;font-size:12px;" class="single-post-message">If you're an advanced developer or just want the TL;DR version of this, <a href=http://tommcfarlin.com/filter-names-in-jquery#code">skip to the code</a>.</p><!-- /.single-post-message --><p>One of the more common UI design patterns is to render a table of data that includes rows that include people&#8217;s names, various information about them, and so on.</p>
<p>Usually, there are some type of control elements that allow you to filter the data by some type of criteria. Obviously, this is especially useful with large datasets where you don&#8217;t want to page through pages of data or scroll for a significantly long length of time.</p>
<p>Though there are a variety of ways to filter data &#8211; especially if you want to do so through the use of different values &#8211; one way that&#8217;s most common is to filter data by a person&#8217;s name.</p>
<p>If the data set is really large, this is often something that&#8217;s best left to process on the server side; however, if the data set is modest, it&#8217;s really easy to filter names in jQuery.</p>
<p><span id="more-11490"></span></p>
<h2>One Way To Set This Up</h2>
<p>Here&#8217;s an example of what I&#8217;m talking about:</p>
<p><img class="aligncenter size-large wp-image-11498" alt="Filter Names in jQuery" src="http://tommcfarlin.com/files/2013/06/2013-06-13-08.44.38-1024x768.png" width="610" height="457" /></p>
<p>Above the table of data, there are anchors on which the users can click to filter the data based on the letter. For all intents an purposes, let&#8217;s say that I want to filter the data by the person&#8217;s last name.</p>
<p>For example, when a user clicks on &#8216;A&#8217; then all people whose last name does <em>not</em> begin with &#8216;A&#8217; will disappear. Then, when you click on the same letter, all names will appear.</p>
<p>Similarly, let&#8217;s say that you click on a different letter, then the current set of data will be hidden and the data matching the clicked letter will display.</p>
<p>Though there are a variety of ways to do this, I&#8217;m doing the following:</p>
<ul>
<li><span style="line-height: 13px">The rows need to be identified by the users last name. As such, that will be the ID of each row.</span></li>
<li>The letter that&#8217;s clicked needs to be identified</li>
<li>We need to hide all elements that do not start with the letter that was clicked</li>
</ul>
<p>Easy enough, right?</p>
<h2 id="code">Filter Names in jQuery</h2>
<p>To make this simple, I&#8217;m only going to be showing small pieces of code to demonstrate the steps that are outlined above.</p>
<h3>Name Each Row</h3>
<p>When the data is rendered out to the page, it should look like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr id=&quot;ames&quot;&gt;
      &lt;td&gt;Ames, Chris&lt;/td&gt;
      &lt;td&gt;...&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id=&quot;erickson&quot;&gt;
      &lt;td&gt;Erickson, Jared&lt;/td&gt;
      &lt;td&gt;...&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id=&quot;...&quot;&gt;
      &lt;td&gt;...&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</pre>
<p>Again, the ID of the row is that of the person&#8217;s last name.</p>
<h3>Identify The Clicked Anchor</h3>
<p>Next, when the user clicks on a letter, we need to be able to identify which letter was clicked. The letters can be stored in a variety of elements &#8211; unordered lists, spans, paragraphs, and so on.</p>
<p>I&#8217;m a fan of using styled, unordered lists so here&#8217;s what my code looks like:</p>
<pre class="brush: xml; title: ; notranslate">&lt;/pre&gt;
&lt;ul id=&quot;alphabet-list&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;javascript:;&quot;&gt;A&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;javascript:;&quot;&gt;B&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;javascript:;&quot;&gt;C&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;javascript:;&quot;&gt;...&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
&lt;!-- /#alphabet-list --&gt;
</pre>
<p>Not that the anchor&#8217;s <code>href</code> attribute is set to <code>javascript:;</code>. This is because we want the let the user know that the text can be clicked (but we&#8217;re going to let the rest of the work be done in JavaScript).</p>
<h3>Filter The Names</h3>
<p>Finally, we&#8217;re ready to filter all rows that do not start with the clicked letter. To do this, <a title="jQuery Selectors" href="http://api.jquery.com/category/selectors/" target="_blank">jQuery&#8217;s selectors</a> make this really easy.</p>
<p>Simply put, we&#8217;ll hide all elements that <em>do not start</em> with the letter that was clicked:</p>
<pre class="brush: jscript; title: ; notranslate">
$('#alphabet-list').on('click', 'li a', function(evt) {

	evt.preventDefault();

	// Grab the letter that was clicked
	var sCurrentLetter = $(this).text().toLowerCase();

	// Now hide all rows that have IDs that do not start with this letter
	$('tbody &gt; tr:not( [id^=&quot;' + sCurrentLetter + '&quot;] )').hide();

});
</pre>
<p>And that does it.</p>
<p>Sure, you can take this a step further and provide some styling and additional filtering to enhance the experience, but this is enough to get started.</p>
<p>Again, this isn&#8217;t something I recommend for exceptionally large datasets, but if the data is relatively modest, then go for it.</p><p><a href="http://tommcfarlin.com/filter-names-in-jquery/">How To Easily Filter Names in jQuery</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/filter-names-in-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Five Ways To Improve Your WordPress Development Skills</title>
		<link>http://tommcfarlin.com/improve-your-wordpress-development-skills/</link>
		<comments>http://tommcfarlin.com/improve-your-wordpress-development-skills/#comments</comments>
		<pubDate>Thu, 13 Jun 2013 12:20:49 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Speaking]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11414</guid>
		<description><![CDATA[<p>One of the things that I enjoy most about blogging is being able to help others (and be helped by others). Aside from that, I&#8217;ve also had a lot of fun at speaking at different events and conferences. In July, I&#8217;ll be speaking here in Atlanta on Five Ways To Improve Your WordPress Development Skills. Here [...]</p><p><a href="http://tommcfarlin.com/improve-your-wordpress-development-skills/">Five Ways To Improve Your WordPress Development Skills</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>One of the things that I enjoy most about blogging is being able to help others (and be helped <em>by</em> others). Aside from that, I&#8217;ve also had a lot of fun at <a title="Speaking" href="http://tommcfarlin.com/speaking/" target="_blank">speaking</a> at different events and conferences. In July, I&#8217;ll be speaking here in Atlanta on <em>Five Ways To Improve Your WordPress Development Skills</em>.</p>
<p>Here are the details on the event:</p>
<p><span id="more-11414"></span></p>
<h2>Improve Your WordPress Development Skills</h2>
<p><img class="aligncenter size-large wp-image-11418" alt="Improve Your WordPress Development Skills" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-11-at-2.00.18-PM-1024x746.png" width="610" height="444" /></p>
<p>On Thursday, July 25, 2013, I&#8217;ll be speaking at the <a title="Business Accelerators" href="https://maps.google.com/maps?q=975+Cobb+Place+Blvd.,+Kennesaw,+GA" target="_blank">Business Accelerators</a> conference center in Kennesaw, Georgia. The talk is geared towards both aspiring and intermediate WordPress developers.</p>
<p>I&#8217;ll be covering the following topics:</p>
<ol>
<li><span style="line-height: 13px">Understand the Importance of the WordPress Codex</span></li>
<li>Learn The WordPress APIs and How To Use Them</li>
<li>Hear Why The Coding Standards Are Important</li>
<li>Learn To Identify Your Niche Within The WordPress Community</li>
<li>How To Continue To Educate Yourself Beyond Conferences</li>
</ol>
<p>The goal is not only to provide some practical advice around improving your WordPress development skills, but also to have an open discussion about any of the above points as well as anything else that&#8217;s relevant.</p>
<h3>The Details</h3>
<p>For those of you in the Atlanta-area, or those of you who are interested in attending, here&#8217;s all the information:</p>
<ul>
<li><span style="line-height: 13px">We&#8217;ll be meeting at the <a title="Business Accelerators" href="https://maps.google.com/maps?q=975+Cobb+Place+Blvd.,+Kennesaw,+GA" target="_blank">Business Accelerators</a> conference center</span></li>
<li>We&#8217;ll be meeting from 9am to 12pm</li>
<li>The price is <strong>$89 through June 30</strong> as an early bird special (30% off the normal ticket price)</li>
<li>You can RSVP and pay via <a title="Five Ways To Improve Your WordPress Development Skills" href="http://www.meetup.com/wpatlanta/events/124074112/" target="_blank">the event&#8217;s meetup page</a>.</li>
</ul>
<p>If you&#8217;ve got any other questions, leave &#8216;em in the comments; otherwise, I hope to see you there.</p><p><a href="http://tommcfarlin.com/improve-your-wordpress-development-skills/">Five Ways To Improve Your WordPress Development Skills</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/improve-your-wordpress-development-skills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmatically Mark a Comment as Unapproved</title>
		<link>http://tommcfarlin.com/mark-a-comment-as-unapproved/</link>
		<comments>http://tommcfarlin.com/mark-a-comment-as-unapproved/#comments</comments>
		<pubDate>Wed, 12 Jun 2013 10:50:05 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11430</guid>
		<description><![CDATA[<p>In a recent project, I was working with someone who wanted to mark a comment as unapproved regardless of the value that was set in the WordPress settings. Specifically, the person was using a plugin that allowed for certain attachments to the plugin. In order to make sure that the comment could be screened prior [...]</p><p><a href="http://tommcfarlin.com/mark-a-comment-as-unapproved/">Programmatically Mark a Comment as Unapproved</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>In a recent project, I was working with someone who wanted to mark a comment as unapproved regardless of the value that was set in the WordPress settings.</p>
<p>Specifically, the person was using a plugin that allowed for certain attachments to the plugin. In order to make sure that the comment could be screened prior to allowing it to go public on the blog, they wanted to moderate it from the dashboard without needed to completely enable comment moderation across the board.</p>
<p>This is something that&#8217;s relatively easy to achieve programmatically.</p>
<p><span id="more-11430"></span></p>
<h2>How To Mark a Comment as Unapproved</h2>
<p>First, you need to register an action with the <code>wp_insert_comment</code> action.</p>
<p>For example:</p>
<pre class="brush: php; title: ; notranslate">add_filter( 'wp_insert_comment', 'example_save_comment' );</pre>
<p>Next, you&#8217;ll need to define the <code>example_save_comment</code> function. Note that this function will receive the comment ID as a parameter whenever the action is called.</p>
<p>As such, the function should look like this:</p>
<pre class="brush: php; title: ; notranslate">
function example_save_comment( $comment_id ) {
    // ...
}
</pre>
<p>After that, it&#8217;s a matter of performing the following steps:</p>
<ol>
<li>Retrieve the comment either as an object or as an array. I&#8217;ll be using an object.</li>
<li>Set the <code>comment_approved</code> flag to 0 (which is used to indicate that it&#8217;s not approved).</li>
<li>Use the <code>wp_update_comment</code> WordPress API function to update the comment.</li>
</ol>
<p>The final version of the function should look like this:</p>
<pre class="brush: php; title: ; notranslate">
function example_save_comment( $comment_id ) {

    // Get the comment based on the incoming ID
    $comment = get_comment( $comment_id );

    // Set its approved comment to 0
    $comment-&gt;comment_approved = 0;

    // Save this value to the database
    wp_update_comment( $comment );

}
</pre>
<p>In the code above, this will actually mark <em>every</em> comment as unapproved, so you&#8217;ll obviously want to use some type of conditional if you&#8217;re looking to only mark <em>some</em> of the comments are unapproved.</p>
<p>But that&#8217;s easy enough &#8211; just wrap the code in the hook in whatever conditional that&#8217;s necessary.</p>
<h2>But There&#8217;s a Gotcha</h2>
<p>The main problem with doing something like this is that it may cause a disjunction between what the user expects to happen and what really happens.</p>
<p>Case in point: Assume that the user as their WordPress settings configured in such a way that once a comment is approved by a single author, then their future comments should always be approved.</p>
<p>With the code above, that&#8217;s not the case.</p>
<p>Arguably, the best way to handle this is to introduce a settings page that gives the user the option to mark a comment (or a specific type of comment, depending on how complicated your work is) as unapproved based on a certain condition.</p>
<p>Though that level of detail is beyond the scope of what I&#8217;m trying to show here, it&#8217;s still an important consideration if you&#8217;re going to be introducing this into a project.</p><p><a href="http://tommcfarlin.com/mark-a-comment-as-unapproved/">Programmatically Mark a Comment as Unapproved</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/mark-a-comment-as-unapproved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functions.php vs Plugin, Who Wins?</title>
		<link>http://tommcfarlin.com/functions-php-vs-plugin-who-wins/</link>
		<comments>http://tommcfarlin.com/functions-php-vs-plugin-who-wins/#comments</comments>
		<pubDate>Tue, 11 Jun 2013 11:05:22 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11354</guid>
		<description><![CDATA[<p>When it comes to introducing custom functionality into a WordPress project, the debate between functions.php vs. plugin usage is nothing new. Generally speaking, I think of themes are presentation and plugins as functionality that transcend whatever theme or themes with which they&#8217;re installed. But sometimes, this delineation isn&#8217;t so clear. For example, let&#8217;s say that you&#8217;re working [...]</p><p><a href="http://tommcfarlin.com/functions-php-vs-plugin-who-wins/">Functions.php vs Plugin, Who Wins?</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>When it comes to introducing custom functionality into a WordPress project, the debate between functions.php vs. plugin usage is nothing new.</p>
<p>Generally speaking, I think of themes are presentation and plugins as functionality that transcend whatever theme or themes with which they&#8217;re installed.</p>
<p>But sometimes, this delineation isn&#8217;t so clear. For example, let&#8217;s say that you&#8217;re working on a theme that needs to introduce a custom meta box &#8211; or several &#8211; into the post editor screen.</p>
<p>Though this <em>is</em> presentation related in that it will impact what&#8217;s displayed to the users, it&#8217;s also a bit of custom functionality but it&#8217;s <em>only</em> relegated to this particular theme.</p>
<p>What then?</p>
<p><span id="more-11354"></span></p>
<h2>Functions.php vs. Plugin Files</h2>
<div id="attachment_11358" class="wp-caption aligncenter" style="width: 540px"><img class="size-full wp-image-11358" alt="Functions.php vs Plugin" src="http://tommcfarlin.com/files/2013/06/fight.jpg" width="530" height="339" /><p class="wp-caption-text">A bit over dramatic, perhaps?</p></div>
<p>Here&#8217;s the thing: Conventional wisdom is the WordPress development community says that anything that exists in <code>functions.php</code> can exist in a plugin file.</p>
<p>This is true, although I think plugins &#8211; especially larger ones &#8211; should be developed using alternative techniques such as object-oriented programming which is something that <code>functions.php</code> cannot offer.</p>
<p>That said, we have to remember that when we&#8217;re working on our projects, it&#8217;s not always a matter of picking either <code>functions.php</code> or using a plugin especially when the custom functionality is unique to the theme yet impacts the presentation of the theme.</p>
<p>Anyone who has built relatively large themes or <em>slightly</em> complex web applications using WordPress knows that <code>functions.php</code> can get large very quickly. On top of that, no matter what amount of documentation you provide, the file simply gets larger which can make it difficult to locate whatever it is that you&#8217;re looking to find.</p>
<p>I think one thing that we often forget is maintenance factor that comes with creating and releasing a theme or application.</p>
<h2>Finding Middle Ground</h2>
<p>To that end, there <em>is</em> middle ground that exists between <code>functions.php</code> and plugins and that&#8217;s to use separate files and place them in a separate directory.</p>
<p>Perhaps it&#8217;s a <code>lib</code> directory, perhaps its an <code>inc</code> directory (which is short for includes), or whatever convention your theme uses.</p>
<div id="attachment_11362" class="wp-caption aligncenter" style="width: 894px"><img class="size-full wp-image-11362" alt="Functions.php vs Plugin" src="http://tommcfarlin.com/files/2013/06/functions-php-vs-plugin.png" width="884" height="552" /><p class="wp-caption-text">Custom functionality located in the <code>inc</code> directory</p></div>
<p>The idea behind this strategy is to make sure that that core theme functionality is kept in <code>functions.php</code>. This includes features such as:</p>
<ul>
<li><span style="line-height: 13px">The content width</span></li>
<li>Theme features such as support for featured images</li>
<li>Functionality related to custom header and custom background support</li>
<li>&#8230;and more</li>
</ul>
<p>Files kept in the <code>inc</code> directory are usually related to core theme functionality but are more specialized. They aren&#8217;t quite plugin territory because they don&#8217;t need to be made available to <em>all</em> themes, but they&#8217;re specific enough to warrant their own file.</p>
<p>This can include:</p>
<ul>
<li><span style="line-height: 13px">Custom post types</span></li>
<li>Meta boxes</li>
<li>Custom menu pages</li>
<li>&#8230;and more</li>
</ul>
<p>Note that this strategy is also employed by a variety of boilerplates and starter themes such as <a title="Underscores" href="http://underscores.me/" target="_blank">Underscores</a>.</p>
<h2>And For What It&#8217;s Worth</h2>
<p>If you find yourself torn between placing something in <code>functions.php</code> or writing a plugin, but still feeling as if both options are wrong, consider this third alternative.</p>
<p>Personally, when it comes to organizing code, I use <code>lib</code> directories to contain third-party libraries, source code, and so on. I also keep them organized on a per-language basis. This means that my JavaScript directory may have a <code>lib</code> directory, as will my CSS, and so on.</p>
<p>Then, I use <code>inc</code> as the directory for my own libraries, code, and functions that are used throughout the theme.</p>
<p>Ultimately, this comes down to a factor of maintenance &#8211; you <em>can</em> make a place for each piece of functionality without sacrificing the integrity of your project, and without having to generalize the functionality into a plugin.</p><p><a href="http://tommcfarlin.com/functions-php-vs-plugin-who-wins/">Functions.php vs Plugin, Who Wins?</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/functions-php-vs-plugin-who-wins/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Tell Me: What Have You Done?</title>
		<link>http://tommcfarlin.com/what-have-you-done/</link>
		<comments>http://tommcfarlin.com/what-have-you-done/#comments</comments>
		<pubDate>Mon, 10 Jun 2013 12:27:37 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=9737</guid>
		<description><![CDATA[<p>When it comes to building, launching, and maintaining your own projects &#8211; be it software, hardware, blogs, sites, songs, paintings, &#8230;, anything, etc. &#8211; one of the things that you have to be prepared for is the amount of criticism to which you&#8217;re opening yourself up. Granted, you have to take the good with the bad, [...]</p><p><a href="http://tommcfarlin.com/what-have-you-done/">Tell Me: What Have You Done?</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>When it comes to building, launching, and maintaining your own projects &#8211; be it software, hardware, blogs, sites, songs, paintings, &#8230;, <em>anything</em>, etc. &#8211; one of the things that you have to be prepared for is the amount of criticism to which you&#8217;re opening yourself up.</p>
<p>Granted, you have to take the good with the bad, but the problem with the bad is that it&#8217;s so much easier to take to heart and/or focus on that the good, right?</p>
<p>But the irony in this is that not only do we <em>subject</em> ourselves to said criticism, but some also <em>offer</em> criticism to what others have done.</p>
<p>If you&#8217;re on the receiving end of said criticism, it&#8217;s easy to get defensive; if you&#8217;re on the giving end of the criticism, it&#8217;s easy to mask it as constructive when, in fact, it may not be at all.</p>
<p>So how do we deal with this kind of stuff on a day-to-day basis?</p>
<p><span id="more-9737"></span></p>
<h2>What Have You Done?</h2>
<p>The truth is that I wish I had an answer.</p>
<div id="attachment_11318" class="wp-caption aligncenter" style="width: 465px"><img class="size-full wp-image-11318" alt="Dear Abby" src="http://tommcfarlin.com/files/2013/06/dear-abby.jpg" width="455" height="553" /><p class="wp-caption-text">Dear Abby: Why does others&#8217; work suck so much?</p></div>
<p>Honestly, even writing this sounds like a &#8220;<a title="Dear Abby" href="http://en.wikipedia.org/wiki/Dear_Abby" target="_blank">Dear Abby</a>&#8221; letter or some type of self-help post, so I can only imagine how it&#8217;s coming off when you&#8217;re reading it <img src='http://tommcfarlin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h3>Come at Me, Bro</h3>
<p>Here&#8217;s what I do know: many of us are our own worst critics, so when we see others criticizing something that we&#8217;re doing, it feels almost a bit like affirmation of a fear that we already have.</p>
<p>Being in that place sucks.</p>
<p>Not only does it make us a bit skeptical about what we&#8217;re doing, but it also puts us on the defense &#8211; which may or may not be warranted &#8211; thus wondering if the effort is even worth it, and likely even feeling a bit of animosity of disrespect towards the critics.</p>
<h3>A Little Help</h3>
<p>I&#8217;d like to think that those who are offering criticism are doing so with the best of intentions, but are simply having to keep it concise thanks to channels such as Twitter that require such short messages (which raises the question: is Twitter the best place for this type of conversation?).</p>
<p>And if you find yourself in <em>that</em> place, then maybe it&#8217;s better if the criticism is kept into an email or something that supports more longer form opinions. Sure, there are other options, but I digress for now.</p>
<h2>Haters Gonna Hate (Or &#8220;Sticks and Stones&#8221;)</h2>
<p>So here&#8217;s the thing: Whenever someone ends up critiquing work we&#8217;ve done, it&#8217;s <em>much</em> easier to simply ask &#8220;Oh yeah, well what have <em>you</em> done?&#8221; as a way to help deflect some of the criticism.</p>
<p>But what does this matter, <em>really</em>?</p>
<p>The thing is, people are going to say what they are going to say whether or not they&#8217;ve done anything. Those who have understand just how hard it is to ship something &#8211; <em>anything</em>, really - and those who don&#8217;t might as well be trolling.</p>
<div id="attachment_11322" class="wp-caption aligncenter" style="width: 760px"><img class="size-full wp-image-11322" alt="Haters Gonna Hate" src="http://tommcfarlin.com/files/2013/06/haters_gonna_hate3.jpg" width="750" height="550" /><p class="wp-caption-text">Haters gonna hate, but I don&#8217;t think that helps.</p></div>
<p>I don&#8217;t know how the rest of you guys and gals handle criticism. For what it&#8217;s worth, I think it&#8217;s actually a learned skill. The more you put yourself out there, the thicker your skin has to get, but the truth is that I don&#8217;t know if the sting of negative critique ever really goes away (of course, that&#8217;s just my experience).</p>
<p>And yeah, it&#8217;s easy to say &#8220;haters gonna hate&#8221; (which is nothing more than the adult version of sticks and stones, am I right? <img src='http://tommcfarlin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ), but if I get caught in a bad day, criticism simply sucks. Plain and simple.</p>
<p>It generates pure old fashioned anger that ends up sending you in a bit of a spiral wondering if it was worth putting said project out there. Surely we can all identify with this in some way.</p>
<h3>Make It Stop!</h3>
<p>As I mentioned earlier in the post:</p>
<blockquote><p>I&#8217;d like to think that those who are offering criticism are doing so with the best of intentions, but are simply having to keep it concise thanks to channels such as Twitter that require such short messages.</p></blockquote>
<p>But the truth is that as much as I&#8217;d <em>like</em> to think that, the truth is that I don&#8217;t really believe that. I see far too many debates, arguments, passive aggressive whatever, and flat-out negativity permeating our social networks to know better.</p>
<p>So how do we actually make this stop? I don&#8217;t think we can. As much as I want to go all John Lennon and &#8220;give peace a chance&#8221; on this kind of stuff, I think that half of being involved in open projects is accepting the potential negativity that exists.</p>
<p style="text-align: center"><img class="aligncenter  wp-image-11326" alt="Give Peace a Chance" src="http://tommcfarlin.com/files/2013/06/john-lennon-peace.jpg" width="614" height="461" /></p>
<p>Dealing with it is the tough spot, sure, and for those of us who have ever offered up criticism of someone else&#8217;s work, perhaps it&#8217;s better if we opt to do it in private first and see what happens <em>then</em> go from there.</p>
<p>It results in being able to provide longer form explanations, examples, discussion, and respect that&#8217;s simply lost in short-form posts.</p>
<p>Then again, it feels almost futile to even mention this because the critics who we&#8217;d like to see do this likely won&#8217;t dig it, anyway. And for those who already do it, the whole post may seem redundant.</p><p><a href="http://tommcfarlin.com/what-have-you-done/">Tell Me: What Have You Done?</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/what-have-you-done/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flatdoc For Documentation with Markdown</title>
		<link>http://tommcfarlin.com/documentation-with-markdown/</link>
		<comments>http://tommcfarlin.com/documentation-with-markdown/#comments</comments>
		<pubDate>Fri, 07 Jun 2013 11:39:30 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11238</guid>
		<description><![CDATA[<p>Several times, I&#8217;ve mentioned that I&#8217;m a huge fan of markdown &#8211; I use it to write emails, I dig that that&#8217;s how GitHub handles README files, I use minor variations of it in my blogging, and I&#8217;ve got a favorite app for it. Thanks to a heads up from one of my partners, I [...]</p><p><a href="http://tommcfarlin.com/documentation-with-markdown/">Flatdoc For Documentation with Markdown</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>Several times, I&#8217;ve mentioned that I&#8217;m a huge fan of markdown &#8211; I use it to write <a title="Markdown Email" href="http://tommcfarlin.com/markdown-email/" target="_blank">emails</a>, I dig that that&#8217;s how GitHub handles README files, I use <a title="Markdown Code For WordPress" href="http://tommcfarlin.com/markdown-code-for-wordpress/">minor variations of it</a> in my blogging, and I&#8217;ve got <a title="Mou For Mac" href="http://tommcfarlin.com/mou-for-mac/" target="_blank">a favorite app</a> for it.</p>
<p>Thanks to a heads up from <a title="Jared Erickson" href="http://twitter.com/alliswell/" target="_blank">one of my partners</a>, I can now write documentation with markdown.</p>
<p>Here&#8217;s the thing: I&#8217;ve mentioned that I&#8217;m a huge advocate for <a title="A Code For Code Comments" href="http://tommcfarlin.com/wordpress-code-comments/">code comments</a> - I think it&#8217;s better to go a little overboard for the sake of clarity than not, especially in open source projects.</p>
<p>And sure, PHP DocBlocks and tools like <a title="PHPDocumentor" href="http://www.phpdoc.org/" target="_blank">PHPDocumentor</a> make it relatively easy to generate documentation, but documentation like that is best suited for other developers. It&#8217;s not exactly end-user friendly, right?</p>
<p>In that case, you&#8217;re talking about writing a manual.</p>
<p><span id="more-11238"></span></p>
<h2>Documentation For Users</h2>
<p>When it comes to writing documentation for users, there&#8217;s a variety of things to consider:</p>
<ul>
<li><span style="line-height: 13px">How easy is it for them to discover the documentation?</span></li>
<li>Is it written in language that <em>they</em> understand?</li>
<li>Is it kept up-to-date with each release?</li>
</ul>
<p>On top of that, there are a number of tools for writing said manual.</p>
<p>Up to this point, my team and I have generally stuck with using WordPress and some light customizations of a theme.</p>
<div id="attachment_11242" class="wp-caption aligncenter" style="width: 620px"><img class="size-large wp-image-11242" alt="The Standard Theme User Manual on WordPress" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-07-at-7.29.15-AM-1024x981.png" width="610" height="584" /><p class="wp-caption-text">The Standard Theme User Manual on WordPress</p></div>
<p>No, it&#8217;s nothing glamorous and it&#8217;s a relatively simple solution, but it gets the job done, it&#8217;s easy to maintain, and it&#8217;s linked up from within the theme admin.</p>
<p>But this still requires a little bit of initial overhead &#8211; namely, setting up the server, database, WordPress installation, and so on.</p>
<h2>Documentation with Markdown</h2>
<p>Enter <a title="Flatdoc" href="http://ricostacruz.com/flatdoc/" target="_blank">Flatdoc</a>.</p>
<div id="attachment_11246" class="wp-caption aligncenter" style="width: 620px"><img class="size-large wp-image-11246" alt="Flatdoc for Documentation with Markdown" src="http://tommcfarlin.com/files/2013/06/Screen-Shot-2013-06-07-at-7.17.53-AM-1024x755.png" width="610" height="449" /><p class="wp-caption-text">Flatdoc for Documentation with Markdown</p></div>
<p>In short, <a title="Flatdoc" href="http://ricostacruz.com/flatdoc/" target="_blank">Flatdoc</a> is an open source project for writing documentation in Markdown.</p>
<p>I love the way it works:</p>
<ul>
<li>Write the documentation using markdown</li>
<li>Include a JavaScript file in a page (and direct the JavaScript to the markdown file)</li>
<li>Provide some options for theme customization</li>
<li>Profit!</li>
</ul>
<p>To be fair, I don&#8217;t think this solution is right for everyone. After all, if you&#8217;ve got someone on your team who&#8217;s in the business of writing documentation for other projects, they have their own tools, and/or they have a different way of doing things, then go for it.</p>
<p>After all, markdown is still one of those languages that leans in the direction of developers.</p>
<p>But that&#8217;s exactly it: If you&#8217;re a developer who <em>wants</em> to include more documentation than that for fellow developers, and you&#8217;re looking for an easy way to do it such that you can write it in markdown format and then have a tool generate a good looking page (or set of pages for you), then Flatdoc&#8217;s the way to go.</p>
<p>I&#8217;m aiming to begin releasing a couple of projects with documentation using Flatdoc. Eager to see how it goes.</p><p><a href="http://tommcfarlin.com/documentation-with-markdown/">Flatdoc For Documentation with Markdown</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/documentation-with-markdown/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Don’t Copy WordPress Plugins</title>
		<link>http://tommcfarlin.com/copy-wordpress-plugins/</link>
		<comments>http://tommcfarlin.com/copy-wordpress-plugins/#comments</comments>
		<pubDate>Thu, 06 Jun 2013 14:18:19 +0000</pubDate>
		<dc:creator>Tom McFarlin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=11158</guid>
		<description><![CDATA[<p>The conversation about the ethics of what it means to copy WordPress plugins, theme, applications, and more isn&#8217;t new. In fact, just the other day, I was having a conversation with a friend of mine about what competition looks like in various marketplaces. Based on my conversation with him (and a number of others, for what [...]</p><p><a href="http://tommcfarlin.com/copy-wordpress-plugins/">Don&#8217;t Copy WordPress Plugins</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></description>
				<content:encoded><![CDATA[<p>The conversation about the ethics of what it means to copy WordPress plugins, theme, applications, and more isn&#8217;t new. In fact, just the other day, I was having a conversation with a friend of mine about what competition looks like in various marketplaces.</p>
<p>Based on my conversation with him (and a number of others, for what it&#8217;s worth), there tends to be two schools of thought on releasing products into a marketplace that can be summed up in the following two statements:</p>
<ul>
<li><span style="line-height: 13px">If a similar product already exists, don&#8217;t do it.</span></li>
<li>If a similar product already exists, do it.</li>
</ul>
<p>Sure, that&#8217;s an oversimplification of the idea and there&#8217;s a lot to be said about both; however, I&#8217;ve seen this same thing discussed in the context of both WordPress theme and plugin development.</p>
<p>Specifically, the quote I read was as follows:</p>
<blockquote><p>1. Check the plugin repository to see if similar plugin exists.</p>
<p>2. If so, don&#8217;t reinvent the wheel.</p></blockquote>
<p>Initially, I categorically disagreed with this perspective.<span id="more-11158"></span></p>
<h2>Believe The Best (Don&#8217;t Assume The Worst)</h2>
<p>But here&#8217;s the thing: As we all know, when it comes to the Internet, we have a habit of condensing our thoughts into the smallest pieces of consumable information &#8211; with the exception of our blogs &#8211; for others to read (thanks to Twitter, Facebook, et al.).</p>
<p>To that end, I think that we owe one another the benefit of the doubt when people make statements like that above, because I want to believe the best (rather than assume the worst) and think that most people won&#8217;t speak in terms of sweeping generalities. That&#8217;s a byproduct of the means of communication we have today.</p>
<p>I hope.</p>
<p>It happens, but surely it&#8217;s not as common as we accuse one another. But I digress.</p>
<p>The point still remains: if a similar plugin &#8211; or product, for that matter &#8211; exists to what you&#8217;re attempting to build should you aim to to create something different?</p>
<p>I don&#8217;t think anyone would advocate for simply copying an existing product down to the bits and bytes (or to the exact design, ingredients, or what have you). By that, I mean what&#8217;s the purpose of doing so?</p>
<ul>
<li>When you go to the grocery store, how many different kinds of ketchup do you see?</li>
<li>How many different brands of cars are available?</li>
<li>What about how many varieties of ice cream we have?</li>
</ul>
<p>All of the above have a single thing in common, too: All ketchup serves the same purpose. All cars get us from point A to point B, and all &#8211; well, most &#8211; ice cream is cold and tastes awesome.</p>
<h3>The Price is Right?</h3>
<div id="attachment_11170" class="wp-caption aligncenter" style="width: 550px"><img class=" wp-image-11170 " alt="The Price is Right" src="http://tommcfarlin.com/files/2013/06/the-price-is-right.jpg" width="540" height="664" /><p class="wp-caption-text">The Price is Right, Right?</p></div>
<p>Odds are, if there&#8217;s already a leader in the market that you&#8217;re attempting to tackle and you aren&#8217;t doing anything different, what incentive to other people have to swap to your product?</p>
<p>One of the primary answers, in this case, is price. If you offer an <i>identical</i> product for a lower price, you may get some conversions, but you can&#8217;t discount emotional or sweat equity.</p>
<p>People put time, energy, and a lot of their work into using an existing product and a cheaper price still may not be enough to convince them it&#8217;s worth swapping.</p>
<h3>Think Different</h3>
<div id="attachment_11174" class="wp-caption aligncenter" style="width: 550px"><img class="size-full wp-image-11174" alt="Think Different" src="http://tommcfarlin.com/files/2013/06/think-different.png" width="540" height="338" /><p class="wp-caption-text">Think different about your solution</p></div>
<p>Here&#8217;s the thing: it&#8217;s important to distinguish if you&#8217;re <em>copying</em> an existing product, or if your core product is the same with a differentiation in features (be it more or less), or a different approach to solving the problem.</p>
<p>At this point, I think it&#8217;s worth pursuing, because there are often n-number of ways to solve a particular problem.</p>
<p>Some do it elegantly and some just do it. If you&#8217;re second or third or ninth to market but you&#8217;ve got a sleeker, more elegant solution to solving the <em>same problem</em> as another product, market it.</p>
<p>Other people will likely take notice and at least investigate it.</p>
<p>And, if you&#8217;ve done the job well, price is less of a factor here. Because if a customer has invested hours in a similar project but it causes them pain, and yours comes around and makes it a dream with which to work, then the cost of their time to migrate to your solution may be worth the extra cash.</p>
<h2>Competition Fosters Innovation</h2>
<p>Overall, I think that it&#8217;s all about how well the problem is solved. It&#8217;s not about copying, it&#8217;s not about imitating, and it certainly isn&#8217;t about ripping off. That&#8217;s a whole other post.</p>
<p>As people seeking to provide a solution to the needs of others, it&#8217;s about making their lives easier. So sure, look to see if another plugin &#8211; or product &#8211; exists, but do so with the intent to know your competition and what you&#8217;re up against &#8211; not to dissuade yourself from working on it.</p><p><a href="http://tommcfarlin.com/copy-wordpress-plugins/">Don&#8217;t Copy WordPress Plugins</a> first appeared on <a rel="author" href="http://tommcfarlin.com/author/tom/">Tom McFarlin</a>'s blog. Consider leaving a comment!</p>]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/copy-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
