<?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>alexking.org &#187; Development</title>
	<atom:link href="http://alexking.org/blog/topic/development/feed" rel="self" type="application/rss+xml" />
	<link>http://alexking.org</link>
	<description>Alex King, Denver Web Developer</description>
	<lastBuildDate>Wed, 08 Feb 2012 17:35:27 +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>http_build_query() Separator Tip</title>
		<link>http://alexking.org/blog/2012/02/02/http_build_query-separator-tip</link>
		<comments>http://alexking.org/blog/2012/02/02/http_build_query-separator-tip#comments</comments>
		<pubDate>Thu, 02 Feb 2012 20:46:04 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=12505</guid>
		<description><![CDATA[I ran into an interesting &#8220;bug&#8221; in Twitter Tools last night that I traced back to http_build_query(). I expected that the query strings generated by this function used &#38; as a separator for the key=value pairs, but on one of our test servers, the separator being used was &#38;amp;. This is a php.ini config setting,&#8230;]]></description>
			<content:encoded><![CDATA[<p>I ran into an interesting &#8220;bug&#8221; in Twitter Tools last night that I traced back to <a href="http://php.net/manual/en/function.http-build-query.php"><code>http_build_query()</code></a>. I expected that the query strings generated by this function used <code>&amp;</code> as a separator for the <code>key=value</code> pairs, but on one of our test servers, the separator being used was <code>&amp;amp;</code>. This is a <a href="http://www.php.net/manual/en/ini.core.php#ini.arg-separator.output">php.ini config setting</a>, so my expectation was clearly based on false assumptions. If you want to make sure that you get a <code>&amp;</code> separator, you can <a href="https://github.com/crowdfavorite/wp-twitter-tools/commit/b36a01a61fc50a61408808cfd96e4c8bbf8a5f95">pass it in as the 3rd parameter</a>.</p>
<p>You&#8217;ll find this is particularly important if you&#8217;re making requests for remote data from within WordPress via <code>wp_remote_get()</code> or similar technique. If you are working on something that is run within WordPress, you can look at using <code>add_query_arg()</code> as an alternative to this as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2012/02/02/http_build_query-separator-tip/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Twitter Tools 3.0 beta 2</title>
		<link>http://alexking.org/blog/2012/01/22/twitter-tools-3-0-beta-2</link>
		<comments>http://alexking.org/blog/2012/01/22/twitter-tools-3-0-beta-2#comments</comments>
		<pubDate>Sun, 22 Jan 2012 23:27:50 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8550</guid>
		<description><![CDATA[I&#8217;ve packaged beta 2 of the next generation version of Twitter Tools. Version 3.0 is a ground-up rewrite on top of the Social platform, with a few features included for backward compatibility. If you&#8217;d like to test the beta, grab it from GitHub. This version fixes several bugs that were found in our QA process,&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve packaged beta 2 of the next generation version of Twitter Tools. Version 3.0 is a ground-up rewrite on top of the Social platform, with a few features included for backward compatibility. If you&#8217;d like to test the beta, <a href="https://github.com/crowdfavorite/wp-twitter-tools/tags">grab it from GitHub</a>.</p>
<p>This version fixes several bugs that were found in our QA process, as well as a few enhancements and initial integration points. The changes since <a href="http://alexking.org/blog/2011/12/14/twitter-tools-3-0-beta-1">beta 1</a>:</p>
<ul>
<li>fix several taxonomy reference bugs that were causing shortcodes and widgets to fail to show tweets</li>
<li>fix logical flaws that were causing the &#8220;include RTs/replies&#8221; settings in widgets to behave inconsistently</li>
<li>disconnect Twitter accounts when they are deleted from Social only when they are shared accounts</li>
<li>manual tweet download is now an AJAX call instead of a full page refresh</li>
<li>cleaner failures if Social plugin is not active</li>
<li>add integration points so that other plugins can extend Twitter Tools</li>
</ul>
<p>Due to some of these taxonomy issues, you may need to delete your existing Tweets and allow them to be recreated so that tweets appear in the widget and shortcodes as expected (any newly imported tweets should be fine with this version).</p>
<p>Still no README file (contributions from testers are welcome), but I expect to get started on that along with final tweaks and packaging for a full release in the near future.</p>
<p>Developers, please feel free to open issues and submit pull requests in <a href="https://github.com/crowdfavorite/wp-twitter-tools">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2012/01/22/twitter-tools-3-0-beta-2/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WP_Query by &#8220;Standard&#8221; Post Format</title>
		<link>http://alexking.org/blog/2012/01/05/wp_query-by-standard-post-format</link>
		<comments>http://alexking.org/blog/2012/01/05/wp_query-by-standard-post-format#comments</comments>
		<pubDate>Fri, 06 Jan 2012 06:56:28 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8324</guid>
		<description><![CDATA[When using WordPress post formats, you&#8217;ll quickly start looking for a way to query WordPress content by the &#8220;standard&#8221; post format. This Trac ticket seeks to work on solving this. The implementation there handles URL-based requests: http://example.com/type/standard/ quite nicely. However the code in that patch doesn&#8217;t (yet) handle direct WP_Query calls. I was hacking on&#8230;]]></description>
			<content:encoded><![CDATA[<p>When using WordPress post formats, you&#8217;ll quickly start looking for a way to query WordPress content by the &#8220;standard&#8221; post format. <a href="http://core.trac.wordpress.org/ticket/16149">This Trac ticket</a> seeks to work on solving this. The implementation there handles URL-based requests:</p>
<p><code>http://example.com/type/standard/</code></p>
<p>quite nicely. However the code in that patch doesn&#8217;t (yet) handle direct WP_Query calls.</p>
<p>I was hacking on this a bit on my own before finding the (much more elegant and complete) code that <a href="http://nacin.com">Nacin</a> contributed. I came up with some working code that does work with WP_Query calls, which I posted in this Gist:</p>
<p><script src="https://gist.github.com/1549613.js"></script><noscript><p>View the code on <a href="https://gist.github.com/1549613">Gist</a>.</p></noscript></p>
<p>Note that this doesn&#8217;t create the taxonomy term and do some of the other nice set-up that Nacin&#8217;s code does. It could use a bit of cleanup &#8211; improvements are very welcome. This isn&#8217;t going to be at the top of my list for a while, so I wanted to make sure I published the code so anyone else who is interested can take a stab at merging the two approaches.</p>
<hr />
<p>For my own usage, I wanted to have the list of recent &#8220;standard&#8221; posts that you see in my sidebar. To create this, I enabled the code in the Gist above, then made a <a href="https://gist.github.com/1569336">slight mod to the Recent Posts widget that is included in core</a>. If you&#8217;ve wanted the same, please grab the code and enjoy.</p>
<p>Note for future visitors: this code is working as desired with WordPress 3.3.x, but will hopefully not be needed in some future version.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2012/01/05/wp_query-by-standard-post-format/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Popularity Contest is Dead (and on GitHub)</title>
		<link>http://alexking.org/blog/2011/12/28/popularity-contest-is-dead-and-on-github</link>
		<comments>http://alexking.org/blog/2011/12/28/popularity-contest-is-dead-and-on-github#comments</comments>
		<pubDate>Wed, 28 Dec 2011 18:43:51 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8264</guid>
		<description><![CDATA[I wrote the Popularity Contest plugin for WordPress back in May of 2005. It had a good run, but that run is over. We are no longer developing or supporting Popularity Contest, and I recommend letting it rest peacefully. Why? It does too much, and too little at the same time. It does too much.&#8230;]]></description>
			<content:encoded><![CDATA[<p>I wrote the Popularity Contest plugin for WordPress back in <a href="http://alexking.org/blog/2005/05/23/popularity-contest">May of 2005</a>. It had a good run, but that run is over. We are no longer developing or supporting Popularity Contest, and I recommend letting it rest peacefully.</p>
<p>Why? It does too much, and too little at the same time.</p>
<p><strong>It does too much.</strong> Popularity Contest tracks each page load. In order to make this compatible with caching plugins, this functionality was abstracted to be done via a second AJAX call (or tracker image in feeds) that bypasses your site&#8217;s caching system.</p>
<p>In other words, with Popularity Contest enabled and a caching plugin installed, each visit to one of your pages still generates an additional dynamic page load request to your server. This is how it has to work, but it&#8217;s too much for most commodity hosting environments.</p>
<p><strong>It does too little.</strong> While Popularity Contest is tracking each page load and updating aggregate numbers relating to your site&#8217;s activity, there is a significant diminishing of returns as you use the plugin over time.</p>
<p>There is no granular data tracked, meaning you cannot plot trends or view popularity in specific time slices. In fact, what I saw on this site was that the most popular posts became simply a list of what ranks highest for popular searches in Google.</p>
<hr />
<p>With all of the free and low-cost analytics solutions out there, you&#8217;re better off using a service to get this sort of information rather than doing it yourself. I&#8217;d recommend <a href="http://google.com/analytics">Google Analytics</a>, <a href="http://wordpress.org/extend/plugins/stats/">WP.com stats</a> or more advanced solutions like <a href="http://www.kissmetrics.com/">KISSmetrics</a>, <a href="https://www.reinvigorate.net/">Reinvigorate</a>, etc.</p>
<p>While I don&#8217;t recommend reviving Popularity Contest for the reasons listed above, but if you&#8217;re interested in forking or looking at the code you are welcome to do so. I pulled a copy of the code from the WP.og SVN repository and put it up on <a href="https://github.com/crowdfavorite/wp-popularity-contest">GitHub</a>. The wp30 branch probably works with the latest version of WordPress with few needed revisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/12/28/popularity-contest-is-dead-and-on-github/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress Plugins and Symlinks</title>
		<link>http://alexking.org/blog/2011/12/15/wordpress-plugins-and-symlinks</link>
		<comments>http://alexking.org/blog/2011/12/15/wordpress-plugins-and-symlinks#comments</comments>
		<pubDate>Thu, 15 Dec 2011 19:45:15 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8196</guid>
		<description><![CDATA[If you&#8217;re doing serious development for WordPress you will quickly find yourself in a situation where you need to test a plugin in multiple installations. Using symlinks is a great way to make sure that you don&#8217;t end up editing in multiple locations, perhaps forgetting to commit a change, etc. However, there are some headaches&#8230;]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re doing serious development for WordPress you will quickly find yourself in a situation where you need to test a plugin in multiple installations. Using symlinks is a great way to make sure that you don&#8217;t end up editing in multiple locations, perhaps forgetting to commit a change, etc.</p>
<p>However, there are some headaches with symlinks &#8211; particularly with common methods of including files:</p>
<p><code>include(dirname(__FILE__).'/my-include-file.php');</code></p>
<p>and related permissions issues if the files live outside the web root, etc.</p>
<p>Trying to figure out the symlink path to the file from within PHP is decidedly non-trivial, so a different approach may work best:</p>
<p><script src="https://gist.github.com/1482350.js"></script><noscript><p>View the code on <a href="https://gist.github.com/1482350">Gist</a>.</p></noscript></p>
<p>Here you can see we are maintaining the location of the file and path that WordPress used to include the file. This has worked well in my experience, perhaps it will be a good solution for you as well.</p>
<p>As always, improvements or suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/12/15/wordpress-plugins-and-symlinks/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Not Getting GitHub Notifications?</title>
		<link>http://alexking.org/blog/2011/11/28/not-getting-github-notifications</link>
		<comments>http://alexking.org/blog/2011/11/28/not-getting-github-notifications#comments</comments>
		<pubDate>Mon, 28 Nov 2011 15:54:57 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Crowd Favorite]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8065</guid>
		<description><![CDATA[I have been moving Crowd Favorite&#8216;s Open Source projects to GitHub (as well as my personal projects). GitHub has great tools for this. We created an organization, added the team members to that organization, and created repositories for our projects. As a few of our projects have enjoyed exactly the sort of developer community engagement&#8230;]]></description>
			<content:encoded><![CDATA[<p>I have been moving <a href="http://crowdfavorite.com">Crowd Favorite</a>&#8216;s Open Source projects to GitHub (as well as my personal projects). GitHub has great tools for this. We created an <a href="http://github.com/crowdfavorite">organization</a>, added the team members to that organization, and created <a href="https://github.com/crowdfavorite/repositories">repositories</a> for our projects.</p>
<p>As a few of our projects have enjoyed exactly the sort of developer community engagement I was hoping for (pull requests, issues, discussion), I discovered that my team was getting email notifications for these events but I was not. Instead, I would hear a comment from a colleague or get an email from someone every few weeks asking why I hadn&#8217;t responded to their issue.</p>
<p>Once you get past a few repositories, it&#8217;s not realistic to click through them all and see if there are new issues that need attention &#8211; the notifications are quite necessary.</p>
<p>After confirming that all notifications were enabled in my account settings, I eventually sent a note into GitHub support. I quickly got a response with the solution:</p>
<blockquote><p>Users in the Owners group don&#8217;t receive notifications.  You need to create a normal team and add yourself to it to get notifications for that team&#8217;s repos.</p></blockquote>
<p>This was indeed the case. If you aren&#8217;t getting notifications for your organizations GitHub repositories and you are in the Owners group, add yourself to another group that has access to the repositories &#8211; that should do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/11/28/not-getting-github-notifications/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting Custom Taxonomies as part of wp_insert_post()</title>
		<link>http://core.trac.wordpress.org/ticket/19373</link>
		<comments>http://alexking.org/blog/2011/11/27/setting-custom-taxonomies-as-part-of-wp_insert_post#comments</comments>
		<pubDate>Sun, 27 Nov 2011 23:00:59 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=8052</guid>
		<description><![CDATA[If you&#8217;re trying to figure out why your custom taxonomies aren&#8217;t being set when you pass them to wp_insert_post() in your custom code, you might be running into the same issue I did. Luckily, it&#8217;s easy to work around once you understand why it is happening.<p style="clear: both;"><a href="http://alexking.org/blog/2011/11/27/setting-custom-taxonomies-as-part-of-wp_insert_post">#</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to figure out why your custom taxonomies aren&#8217;t being set when you pass them to <code>wp_insert_post()</code> in your custom code, you might be running into the same issue I did. Luckily, it&#8217;s easy to work around once you understand why it is happening.</p>
<p style="clear: both;"><a href="http://alexking.org/blog/2011/11/27/setting-custom-taxonomies-as-part-of-wp_insert_post">#</a></p>]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/11/27/setting-custom-taxonomies-as-part-of-wp_insert_post/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress Post Format Fallbacks</title>
		<link>http://alexking.org/blog/2011/11/02/wordpress-post-format-fallbacks</link>
		<comments>http://alexking.org/blog/2011/11/02/wordpress-post-format-fallbacks#comments</comments>
		<pubDate>Wed, 02 Nov 2011 16:27:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Crowd Favorite]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=7835</guid>
		<description><![CDATA[While our post formats admin UI is getting a nice warm reception (100+ tweets, pings and comments, wow!), there is a concern that has popped up a few times &#8211; one that I included a nod towards in my original post. What happens when publishers put important data in the post format custom fields, then&#8230;]]></description>
			<content:encoded><![CDATA[<p>While our <a href="http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui">post formats admin UI</a> is getting a nice warm reception (100+ tweets, pings and comments, wow!), there is a concern that has popped up a few times &#8211; one that I included a nod towards in my original post.</p>
<blockquote><p>What happens when publishers put important data in the post format custom fields, then choose to change to a theme that doesn&#8217;t support these fields?</p></blockquote>
<p>It&#8217;s a legitimate concern, and (as noted previously) one that I had an interesting discussion with <a href="http://iandanielstewart.com/">Ian</a> about at WordCamp SF this year. His idea of core functionality that could tack the data on at output seems like a great solution.</p>
<p><strong>In Open Source, code talks.</strong></p>
<p>I&#8217;ve put together a <a href="https://github.com/crowdfavorite/wp-post-formats-fallback">proof-of-concept plugin that does exactly this</a> with the data fields supported by our <a href="https://github.com/crowdfavorite/wp-post-formats">post formats UI plugin</a>.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/11/Screen-Shot-2011-11-01-at-8.04.25-PM-398x510.png" alt="Post Format Fallbacks" width="398" height="510" class="alignnone size-medium-img wp-image-7837" /></p>
<p>With this plugin enabled, the information in custom fields is automatically added to the post content. In the event the publisher switches to a theme that either doesn&#8217;t support post formats (or doesn&#8217;t support the custom fields our admin UI provides for), they could enable this plugin and their posts would have all the information displayed that they expect.</p>
<p>Once WordPress 3.3 is out the door, I&#8217;ll submit these plugins for consideration and discussion to be included in core. In the meantime, this should at least minimize data portability concerns for theme developers.</p>
<p>Fellow developers, please help this improve! <a href="https://github.com/crowdfavorite/wp-post-formats-fallback">Fork it on GitHub</a>, provide feedback and enhancements, etc. This was put together in a few hours yesterday afternoon, so it is <em>very</em> lightly tested and should be considered a starting point. There are some simple checks in place to try to avoid situations where the auto-added content would duplicate content manually inserted into the post, but I&#8217;m guessing that can be improved a bit (it&#8217;s entirely lacking for image formats, for example).</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/11/02/wordpress-post-format-fallbacks/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress Post Formats Admin UI</title>
		<link>http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui</link>
		<comments>http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui#comments</comments>
		<pubDate>Tue, 25 Oct 2011 21:44:02 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Crowd Favorite]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=7731</guid>
		<description><![CDATA[The Post Formats feature that landed in WordPress 3.1 is a great framework feature. I&#8217;m leveraging it extensively on this site to drive my link, status, photo and gallery posts. While it is a great framework feature, it only really exists as something developers leverage to extend WordPress. There is no UI that ships with&#8230;]]></description>
			<content:encoded><![CDATA[<p>The Post Formats feature that landed in WordPress 3.1 is a great framework feature. I&#8217;m leveraging it extensively on this site to drive my <a href="http://alexking.org/blog/format/link">link</a>, <a href="http://alexking.org/blog/format/status">status</a>, <a href="http://alexking.org/blog/format/image">photo</a> and <a href="http://alexking.org/blog/format/gallery">gallery</a> posts.</p>
<p>While it is a great framework feature, it only really exists as something developers leverage to extend WordPress. There is no UI that ships with the feature, which limits its accessibility to users.</p>
<p><a href="http://crowdfavorite.com">My team and I</a> have been working on <a href="http://crowdfavorite.com/favepersonal/">FavePersonal</a> (the theme you see here) for a while, and one of the features we&#8217;ve built is an admin interface for post formats.</p>
<p><strong>We have <a href="https://github.com/crowdfavorite/wp-post-formats">released this code on GitHub</a> (pull requests welcome) and encourage any and all theme developers to use it, add to it and improve it.<br />
</strong></p>
<hr />
<p>Here are some details on how it works.</p>
<p>The plugin is a completely additive solution that leverages the default WordPress functionality, while improving the UI and standardizing the names and presentation of custom fields that support the various post formats.</p>
<p><strong>A set of tabs</strong> are added to the post authoring screen that allow users to select the post format they would like to use. The built-in radio button interface is hidden, and the tabs simply control the selected radio button.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-standard-510x244.png" alt="Standard Format" width="510" height="244" class="alignnone size-medium-img wp-image-7775" /></p>
<p><strong>Status posts</strong> are treated as &#8220;content only&#8221; &#8211; similar to the short form seen in Facebook status updates and Twitter&#8217;s tweets. Behind the scenes, a title for the post is set using the first 50 characters of the content.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-status-510x202.png" alt="Status Format" width="510" height="202" class="alignnone size-medium-img wp-image-7776" /></p>
<p><strong>Link posts</strong> have an additional custom field (<code>_format_link_url</code>) for the URL of the website/page being linked to. This URL is then utilized in the theme to implement linking directly to the external site from the title link (if desired).</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-link-510x301.png" alt="Link Format" width="510" height="301" class="alignnone size-medium-img wp-image-7773" /></p>
<p><strong>Image posts</strong> utilize the WordPress built-in Featured Image functionality. The Featured Image is treated as the image for the post, and the theme displays it accordingly for this post format.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-image-510x371.png" alt="Image Format" width="510" height="371" class="alignnone size-medium-img wp-image-7772" /></p>
<p><strong>Gallery posts</strong> display the WordPress gallery in the tab so that it&#8217;s clear that these items will appear with the post. The theme then implements the gallery view based on the post format.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-gallery-510x392.png" alt="Gallery Format" width="510" height="392" class="alignnone size-medium-img wp-image-7771" /></p>
<p><strong>Video posts</strong> have an additional field added for embed code or an oEmbed URL to be added. This information is stored in a custom field (<code>_format_video_embed</code>). Then the theme can use this to display the video in an elegant way.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-video-510x267.png" alt="Video Format" width="510" height="267" class="alignnone size-medium-img wp-image-7777" /></p>
<p><strong>Quote posts</strong> have two additional fields. One for the name of the person being quoted (<code>_format_quote_source_name</code>), and one for an attribution link (<code>_format_quote_source_url</code>). These can be used in the theme to present the quote and attribution in a consistent manner. Similar to status posts, a title for the quote is created behind the scenes from the first 50 characters of the quote.</p>
<p><img src="http://alexking.org/wp-content/uploads/2011/10/format-quote-510x258.png" alt="" title="format-quote" width="510" height="258" class="alignnone size-medium-img wp-image-7774" /></p>
<p>You&#8217;ll notice that we have adopted a consistent naming convention for custom fields used to support post formats. That convention is:</p>
<p><code>_format_<strong>{format type}</strong>_<strong>{descriptive data name}</strong></code></p>
<p>The underscore at the beginning of the key prevents the field from showing up in the default Custom Fields interface (since we are managing it behind the scenes) and the rest is set up to logically describe the type of data being stored.</p>
<hr />
<p>We look forward to releasing our theme in the near future, and hope that this code will be widely used to help bring adoption of post formats in a way that is truely portable between WordPress themes.</p>
<p>Several people I&#8217;ve shown this to have asked if I&#8217;d like to see this adopted in WordPress core. Yes, of course! I had an interesting conversation with <a href="http://iandanielstewart.com/">Ian Stewart</a> about this at WordCamp SF this year. He had some reasonable concerns about the data being stored in custom fields not being portable to themes that don&#8217;t implement post formats; while acknowledging that having the data in a structured format (separate fields) was very valuable for presentation purposes.</p>
<p>One possible solution we discussed would be the addition of core functionality that would look for these custom fields and post format support, and would auto-prepend/append the custom fields to the content accordingly (add the featured image, gallery, quote attribution, etc.). A solution like this is definitely preferable to requiring all of the data to be present in a single content field.</p>
<p>UPDATE: see my <a href="http://alexking.org/blog/2011/11/02/wordpress-post-format-fallbacks">follow-up on this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui/feed</wfw:commentRss>
		<slash:comments>144</slash:comments>
		</item>
		<item>
		<title>wp_publish_post() Does Not Set post_*</title>
		<link>http://alexking.org/blog/2011/09/19/wp_publish_post-does-not-set-post_</link>
		<comments>http://alexking.org/blog/2011/09/19/wp_publish_post-does-not-set-post_#comments</comments>
		<pubDate>Mon, 19 Sep 2011 15:44:20 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=7260</guid>
		<description><![CDATA[The inline documentation for wp_publish_post() says that it will: Publish a post by transitioning the post status. and that&#8217;s exactly what it does. Moreover, that&#8217;s all it does. If you are creating a draft post via wp_insert_post() (or wp_update_post(), which calls wp_insert_post()), certain defaults will be set for you when the post status is set&#8230;]]></description>
			<content:encoded><![CDATA[<p>The inline documentation for <code>wp_publish_post()</code> says that it will:</p>
<blockquote><p>Publish a post by transitioning the post status.</p></blockquote>
<p>and that&#8217;s exactly what it does. Moreover, that&#8217;s <em>all</em> it does.</p>
<p>If you are creating a draft post via <code>wp_insert_post()</code> (or <code>wp_update_post()</code>, which calls <code>wp_insert_post()</code>), certain defaults will be set for you when the post status is set to <code>publish</code> (or <code>future</code>, etc.). Among these is the automatic creation of the <code>post_name</code> from the <code>post_title</code> (if none has been explicitly provided) and setting <code>post_date_gmt</code>.</p>
<p>I had <a href="https://github.com/alexkingorg/wp-flickr-post">some</a> <a href="https://github.com/alexkingorg/wp-pinboard-post">code</a> on my site that was hitting a service to get data, creating a draft, adding some meta data and taxonomy information, then publishing it. When I was initially doing this (and using <code>wp_publish_post()</code> instead of <code>wp_update_post()</code>), I was ending up with published, unnamed posts. Not what I had in mind.</p>
<p>There are two ways around this:</p>
<ol>
<li>Use <code>wp_update_post()</code> instead of <code>wp_publish_post()</code>. This works fine, but it&#8217;s a little heavier, and conceptually I think the code reads better with the <code>wp_publish_post()</code> call instead.</li>
<li>Use <code>wp_publish_post()</code>, but make sure to set the <code>post_name</code>, <code>post_date_gmt</code>, etc. when you create your draft post via <code>wp_insert_post()</code>.</li>
</ol>
<p>For what it&#8217;s worth, I was using <code>wp_update_post()</code>, switched to <code>wp_publish_post()</code> because it seemed cleaner, and have since gone back to <code>wp_update_post()</code>. Using less of my own code and letting WordPress core code do more work for me feels more future-proof.</p>
<p>Hopefully this is useful to someone else who starts digging through the code and is having trouble deciding which of the various functions to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/09/19/wp_publish_post-does-not-set-post_/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Wanted: Multiple Incognito Sessions</title>
		<link>http://alexking.org/blog/2011/09/18/wanted-multiple-incognito-sessions</link>
		<comments>http://alexking.org/blog/2011/09/18/wanted-multiple-incognito-sessions#comments</comments>
		<pubDate>Sun, 18 Sep 2011 17:04:51 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=7246</guid>
		<description><![CDATA[Steve laments the lack of easy &#8220;Incognito&#8221; windows in Firefox. I tried Safari as my primary browser for a few weeks when I upgraded to Lion and I really missed this as well. Once it becomes part of your workflow, it&#8217;s really hard to go back. I actually want it to go a step further.&#8230;]]></description>
			<content:encoded><![CDATA[<p>Steve laments the <a href="https://twitter.com/sogrady/status/115463716069322752">lack of easy &#8220;Incognito&#8221; windows in Firefox</a>. I tried Safari as my primary browser for a few weeks when I upgraded to Lion and I really missed this as well. Once it becomes part of your workflow, it&#8217;s really hard to go back.</p>
<p>I actually want it to go a step further. I want each new Incognito window to be a full separate session. The tabs within that window would belong to that session, but I could pop open new Incognito windows as desired and each would be their own session. Using this, you could log into the same website under as many different accounts as you wanted to &#8211; a killer feature for developers to be sure.</p>
<hr />
<p>Sidenote: There doesn&#8217;t seem to be an <a href="http://www.quora.com/Twitter-1/Is-there-a-way-to-link-to-a-Twitter-conversation-including-a-tweet-+-any-replies-+-handpicked-tweets">easy way to link to a Twitter conversation</a> (tweet + replies). That&#8217;s one area where Google+ currently beats Twitter handily. I see folks throwing around links to Google+ conversations all the time (hmmm, Wave?).</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/09/18/wanted-multiple-incognito-sessions/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Modernizr.touch and BlackBerry Browsers</title>
		<link>http://alexking.org/blog/2011/09/15/modernizr-touch-and-blackberry-browsers</link>
		<comments>http://alexking.org/blog/2011/09/15/modernizr-touch-and-blackberry-browsers#comments</comments>
		<pubDate>Thu, 15 Sep 2011 23:03:34 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=7141</guid>
		<description><![CDATA[If you&#8217;re using Moderinzr to detect browser support for touch events, be aware that non-touch BlackBerry devices claim to support touch events. As you might expect, the touch events are pretty much impossible to trigger on a non-touch device. I worked around this by making the check for touch vs. non-touch browsers also test for&#8230;]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using <a href="http://www.modernizr.com/">Moderinzr</a> to detect browser support for touch events, be aware that <a href="https://github.com/Modernizr/Modernizr/issues/372">non-touch BlackBerry devices claim to support touch events</a>. As you might expect, the touch events are pretty much impossible to trigger on a non-touch device.</p>
<p>I worked around this by making the check for touch vs. non-touch browsers also test for a BlackBerry user agent string; then lumping all BlackBerry devices into the non-touch bucket (you&#8217;ll get &#8220;click&#8221; and like it). This is a bit broad, but for my simple use case it was a fine trade-off.</p>
<p>Feel free to post other solutions in the comments&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/09/15/modernizr-touch-and-blackberry-browsers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Fields vs. Taxonomies</title>
		<link>http://alexking.org/blog/2011/08/29/wordpress-post-meta-taxonomies</link>
		<comments>http://alexking.org/blog/2011/08/29/wordpress-post-meta-taxonomies#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:53:18 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=6976</guid>
		<description><![CDATA[For years I&#8217;ve used custom fields (post meta) in WordPress as a primary storage area for misc. data about specific posts (including pages, custom post types, etc.). Recently, I&#8217;ve realized that I should be using custom taxonomies instead of custom fields in a variety of situations. Custom fields are still the right choice for misc.&#8230;]]></description>
			<content:encoded><![CDATA[<p>For years I&#8217;ve used custom fields (post meta) in WordPress as a primary storage area for misc. data about specific posts (including pages, custom post types, etc.). Recently, I&#8217;ve realized that I should be using custom taxonomies instead of custom fields in a variety of situations.</p>
<p>Custom fields are still the right choice for misc. data that is used for display purposes only, or descriptive data about a post that is used by a behind-the-scenes process. You can serialize data here to store the equivalent of cached relational data. You can set flags for various behavior triggers, etc. You can also create a custom user interface for adding and editing the data you need to store.</p>
<p>Where you should use a custom taxonomy instead is for any data that you need to query on. For example, getting all posts that were broadcast to Twitter; all posts that were created by an outside process; all posts that have a certain workflow status.</p>
<p>The reason to favor a custom taxonomy in these situations has to do with the WordPress database structure. Queries by taxonomy are well optimized as this is a primary front-end presentation feature in WordPress core. Conversely, querying by custom field key and value is slow. The value column in the custom field table is not indexed &#8211; you are basically doing a search through data that is not intended for that purpose.</p>
<p>(Yes, as a workaround you can create a NoSQL-style composite key that contains both the key and value in the key column (key = &#8216;featured-yes&#8217; instead of key = &#8216;featured&#8217; and value = &#8216;yes&#8217;), but there are only a handful of solutions where I&#8217;ve thought this is a more elegant solution than using a custom taxonomy.)</p>
<p>Remember, you can still create a custom admin UI for your custom taxonomy (perhaps to enforce single selection, hide certain options in certain situations, etc.). Or you could choose not to expose the data on the front or back end at all and just manage it in code behind the scenes. However, if you do want to expose it, WordPress already has a bunch of tools to let you do this (clean URLs, pagination, feeds, etc.).</p>
<hr />
<p>I think my previous mindset of being focused primarily on using custom fields is partly because they existed before custom taxonomy support was part of WordPress core. One of the hardest things to do as a developer is realize when things have changed and part of your library of knowledge is no longer accurate/relevant. I know I harbor grudges against various apps, platforms, etc. that are certainly based on outdated information (I just don&#8217;t know which ones). <img src='http://alexking.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/08/29/wordpress-post-meta-taxonomies/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Where to Host WordPress Code?</title>
		<link>http://alexking.org/blog/2011/08/26/where-to-host-wordpress-code</link>
		<comments>http://alexking.org/blog/2011/08/26/where-to-host-wordpress-code#comments</comments>
		<pubDate>Fri, 26 Aug 2011 18:04:00 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=5914</guid>
		<description><![CDATA[I talked to a number of developers about at this year&#8217;s WordCamp SF about where best to publish WordPress code as a developer. We definitely want to use the SVN repositories on WordPress.org so that released plugins can be easily available to the community, but there is very little developer community there. We&#8217;ve also used&#8230;]]></description>
			<content:encoded><![CDATA[<p>I talked to a number of developers about at this year&#8217;s WordCamp SF about where best to publish WordPress code as a developer.</p>
<p>We definitely want to use the SVN repositories on WordPress.org so that released plugins can be easily available to the community, but there is very little developer community there. We&#8217;ve also used <a href="http://code.google.com/p/carrington/">Google Code hosting</a> in the past. It&#8217;s nice to have issue tracking, etc. but again there is not much community there. GitHub has a vibrant developer community and great collaboration tools, but it&#8217;s Git and the WordPress developer community infrastructure runs on SVN.</p>
<p>After a good bit of discussion within our team and discussion with other WordPress developers, we&#8217;ve decided to <a href="https://github.com/crowdfavorite">move everything to GitHub</a>. We&#8217;ll still push the code to the WordPress SVN repos as a packaging step, and will occasionally have to maintain mirrored SVN repositories for specific projects; but the active development will happen in GitHub.</p>
<p>We have a few different projects that I think will really benefit from wider community involvement. In particular, we&#8217;ll be moving over our <a href="http://crowdfavorite.com/wordpress/carrington/">Carrington Core theme platform</a>, our <a href="http://wordpress.org/extend/plugins/revision-manager/">CF Revision Manager</a> plugin, and our <a href="https://github.com/crowdfavorite/wp-post-formats">CF Post Formats</a> code (which I moved earlier this week). Over time, we&#8217;ll get everything moved over &#8211; I&#8217;m hoping that we&#8217;ll start seeing forks and pull requests for these projects on GitHub.</p>
<p>Personally I&#8217;m going to be putting more and more code snippets on GitHub so that I can make code more generally available to the community without needing to package it up a plugin. </p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/08/26/where-to-host-wordpress-code/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>WordPress Filter for Pingbacks</title>
		<link>http://alexking.org/blog/2011/08/24/wordpress-pingbacks-filter</link>
		<comments>http://alexking.org/blog/2011/08/24/wordpress-pingbacks-filter#comments</comments>
		<pubDate>Wed, 24 Aug 2011 16:58:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://alexking.org/?p=6910</guid>
		<description><![CDATA[My team and I have been working on a plugin to enable a better UI for post formats in the WordPress admin (more on this later, but feel free to grab the code and play with it). One of the things we&#8217;ve done is standardize on some custom field names for various bits of data&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://crowdfavorite.com">My team</a> and I have been working on a plugin to enable a better UI for post formats in the WordPress admin (more on this later, but feel free to <a href="https://github.com/crowdfavorite/wp-post-formats">grab the code</a> and play with it). One of the things we&#8217;ve done is standardize on some custom field names for various bits of data that are needed to support the different post formats. For link posts, we&#8217;re storing the link URL in a post meta field so that we can output it instead of the default post permalink in various spots in the theme and feeds.</p>
<p>This works great, but we discovered that moving the URL out of the post body  <img src="http://alexking.org/wp-content/themes/alexking.org-v3/smilies/ak_scare1.gif" alt=":air:" class="wp-smiley" />  breaks  <img src="http://alexking.org/wp-content/themes/alexking.org-v3/smilies/ak_scare2.gif" alt=":/air:" class="wp-smiley" />  another feature: pingbacks.</p>
<p>Pingbacks currently work in a very specific way. The post content is parsed for external URLs, then a ping is sent for each of these URLs letting them know they were referenced. Unfortunately, in the current version of WordPress there was no way to get any additional URLs into this list (and we aren&#8217;t storing the URL in the post content where it would be found automatically).</p>
<p>I created a <a href="http://core.trac.wordpress.org/ticket/18506">very small patch</a> to add a filter into the pingback process. With this, I&#8217;m able to add a few lines of code that takes the URL from the custom field and add it to the list of URLs that need to be pinged.</p>
<p><script src="https://gist.github.com/1167389.js"></script><noscript><p>View the code on <a href="https://gist.github.com/1167389">Gist</a>.</p></noscript></p>
<p>I&#8217;m adamantly against making changes to WordPress core code in almost all circumstances, but the exception is patches that look like they&#8217;re on track for inclusion in the next release. Early indications for this one appear positive (thanks Nacin!). If you need this feature before it makes it into core, you can grab the patch. I&#8217;m running it here so that my link posts send pings as I feel is appropriate.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexking.org/blog/2011/08/24/wordpress-pingbacks-filter/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

