<?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>Ben Lobaugh Online &#187; blobaugh</title>
	<atom:link href="http://ben.lobaugh.net/blog/author/blobaugh/feed" rel="self" type="application/rss+xml" />
	<link>http://ben.lobaugh.net/blog</link>
	<description>/(bb&#124;[^b]{2})/</description>
	<lastBuildDate>Mon, 21 May 2012 03:14:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Lowrey HR-10 organ for sale</title>
		<link>http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale</link>
		<comments>http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale#comments</comments>
		<pubDate>Tue, 08 May 2012 01:02:11 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Randomness]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=17555</guid>
		<description><![CDATA[I have a Lowrey HR-1o organ for sale. The organ is in perfect working condition and comes with the original owners manual and training manuals. Asking $500 obo. The Craigslist posting is http://seattle.craigslist.org/see/msg/3002364958.html . Respond there or leave a comment here if you are interested.]]></description>
			<content:encoded><![CDATA[<p>I have a Lowrey HR-1o organ for sale. The organ is in perfect working condition and comes with the original owners manual and training manuals. Asking $500 obo. The Craigslist posting is http://seattle.craigslist.org/see/msg/3002364958.html . Respond there or leave a comment here if you are interested.</p>

<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1046' title='IMG_1046'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1046-150x150.jpg" class="attachment-thumbnail" alt="IMG_1046" title="IMG_1046" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1048' title='IMG_1048'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1048-150x150.jpg" class="attachment-thumbnail" alt="IMG_1048" title="IMG_1048" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1049' title='IMG_1049'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1049-150x150.jpg" class="attachment-thumbnail" alt="IMG_1049" title="IMG_1049" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1050' title='IMG_1050'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1050-150x150.jpg" class="attachment-thumbnail" alt="IMG_1050" title="IMG_1050" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1051' title='IMG_1051'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1051-150x150.jpg" class="attachment-thumbnail" alt="IMG_1051" title="IMG_1051" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1052' title='IMG_1052'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1052-150x150.jpg" class="attachment-thumbnail" alt="IMG_1052" title="IMG_1052" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1053' title='IMG_1053'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1053-150x150.jpg" class="attachment-thumbnail" alt="IMG_1053" title="IMG_1053" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1054' title='IMG_1054'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1054-150x150.jpg" class="attachment-thumbnail" alt="IMG_1054" title="IMG_1054" /></a>
<a href='http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/img_1055' title='IMG_1055'><img width="150" height="150" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/05/IMG_1055-150x150.jpg" class="attachment-thumbnail" alt="IMG_1055" title="IMG_1055" /></a>

]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/17555/lowrey-hr-10-organ-for-sale/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hamburger Potato Dish</title>
		<link>http://ben.lobaugh.net/blog/14279/hamburger-potato-dish-2</link>
		<comments>http://ben.lobaugh.net/blog/14279/hamburger-potato-dish-2#comments</comments>
		<pubDate>Fri, 13 Apr 2012 21:26:29 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Recipe]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=14279</guid>
		<description><![CDATA[Slice 4-5 potatoes in greased casserole. Salt and pepper to taste. Slice 1 onion over potatoes. Fry 1 pound hamburger and spread over potato mixture. Mix: 1 can cream of mushroom soup 1 can milk (soup can) Pour over mixture. stir once. Bake 45-60 minutes or until potatoes are done. Sometime during the last 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Slice 4-5 potatoes in greased casserole. Salt and pepper to taste. Slice 1 onion over potatoes. Fry 1 pound hamburger and spread over potato mixture. Mix:</p>
<p>1 can cream of mushroom soup<br />
1 can milk (soup can)</p>
<p>Pour over mixture. stir once. Bake 45-60 minutes or until potatoes are done. Sometime during the last 10 minutes of baking spread grated cheese on the top.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/14279/hamburger-potato-dish-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RaeAnn&#8217;s Amazing Peanut Butter Cookies</title>
		<link>http://ben.lobaugh.net/blog/14277/raeanns-amazing-peanut-butter-cookies</link>
		<comments>http://ben.lobaugh.net/blog/14277/raeanns-amazing-peanut-butter-cookies#comments</comments>
		<pubDate>Fri, 13 Apr 2012 21:25:28 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Recipe]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=14277</guid>
		<description><![CDATA[Chocolate Chip and Peanut [butter] Cookies 1/2 cup butter or margarine, softened 1/2 cup granulated sugar 1/4 cup brown sugar, packed 1 egg 1 teaspoon vanilla 1 cup all purpose flour 1/2 teaspoon salt 1/2 teaspoon baking soda 1 6 ounce package (1 cup) semisweet chocolate pieces 1 cup peanut [butter] Preheat oven to 375 [...]]]></description>
			<content:encoded><![CDATA[<p>Chocolate Chip and Peanut [butter] Cookies</p>
<p>1/2 cup butter or margarine, softened<br />
1/2 cup granulated sugar<br />
1/4 cup brown sugar, packed<br />
1 egg<br />
1 teaspoon vanilla<br />
1 cup all purpose flour<br />
1/2 teaspoon salt<br />
1/2 teaspoon baking soda<br />
1 6 ounce package (1 cup) semisweet chocolate pieces<br />
1 cup peanut [butter]</p>
<p>Preheat oven to 375 Degrees F</p>
<p>Cream butter or margarine and sugars; add egg, vanilla and beat until light and fluffy. Sift together flour, salt, and baking soda; stir into creamed mixture; blend well. Add chocolate pieces and peanut [butter] and stir by hand.</p>
<p>Drop from teaspoon about 2 inches apart on a greased (I don't grease because I use peanut butter not peanuts) cookie sheet. Bake in 375 F oven 12-14 minutes. Remove from sheet immediately.</p>
<p>Yield: 3 dozen Cookies.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/14277/raeanns-amazing-peanut-butter-cookies/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing for Windows Azure in WordPress</title>
		<link>http://ben.lobaugh.net/blog/11491/developing-for-windows-azure-in-wordpress</link>
		<comments>http://ben.lobaugh.net/blog/11491/developing-for-windows-azure-in-wordpress#comments</comments>
		<pubDate>Mon, 26 Mar 2012 17:34:58 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=11491</guid>
		<description><![CDATA[Windows Azure is a very powerful and capable cloud hosting platform. Whether you are looking for highly scalable hosting, huge cloud storage, unshakable SQL Server, or massive CDN and caching, Windows Azure may have an answer for you. Windows Azure supports many open source technologies, including PHP and therefore it also handles WordPress. Running an [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Windows Azure" href="http://www.windowsazure.com" onclick="return TrackClick('http%3A%2F%2Fwww.windowsazure.com','Windows+Azure')" onclick="return TrackClick('http%3A%2F%2Fwww.windowsazure.com','Windows+Azure')" target="_blank">Windows Azure</a> is a very powerful and capable cloud hosting platform. Whether you are looking for highly scalable hosting, huge cloud storage, unshakable SQL Server, or massive CDN and caching, <a title="Windows Azure" href="http://www.windowsazure.com" onclick="return TrackClick('http%3A%2F%2Fwww.windowsazure.com','Windows+Azure')" onclick="return TrackClick('http%3A%2F%2Fwww.windowsazure.com','Windows+Azure')" target="_blank">Windows Azure</a> may have an answer for you. Windows Azure supports many open source technologies, including <a title="PHP" href="http://php.net" onclick="return TrackClick('http%3A%2F%2Fphp.net','PHP')" target="_blank">PHP</a> and therefore it also handles <a title="WordPress.org" href="http://wordpress.org" onclick="return TrackClick('http%3A%2F%2Fwordpress.org','WordPress.org')" target="_blank">WordPress</a>.</p>
<p>Running an application in "The Cloud" is a far different experience than running on a traditional shared or dedicated host, and to tap into some of the features of the platform the <a title="Microsoft Interoperability Team" href="http://www.interoperabilitybridges.com/" onclick="return TrackClick('http%3A%2F%2Fwww.interoperabilitybridges.com%2F','Microsoft+Interoperability+Team')" target="_blank">Microsoft Interoperability Team</a> has worked hard to deliver open source solutions to the community to enable applications to run faster and more smoothly. Let's run down a few of the resources currently available.</p>
<h2>Pre-built starter solution</h2>
<p>The MS-Interop team has released (on Github!!) a prepackaged solution that will get you a WordPress site fully configured to run on the Windows Azure platform in minutes. From there you can start customizing it with your own plugins and themes, as well as perform any custom development for Windows Azure itself.</p>
<p>The files can be found on <a title="Microsoft Interoperability Team Github account" href="https://github.com/Interop-Bridges" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FInterop-Bridges','Microsoft+Interoperability+Team+Github+account')" target="_blank">Interoperability Bridges Github</a> account under the <a title="WordPress scaffold for Windows Azure" href="https://github.com/Interop-Bridges/Windows-Azure-PHP-Scaffolders" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FInterop-Bridges%2FWindows-Azure-PHP-Scaffolders','WordPress+scaffold+for+Windows+Azure')" target="_blank">Windows Azure PHP Scaffolders</a> repository.</p>
<p>Additionally, two very good tutorials can be found on the <a title="Windows Azure PHP website" href="http://azurephp.interoperabilitybridges.com" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com','Windows+Azure+PHP+website')" target="_blank">Azure PHP</a> website for getting WordPress running:</p>
<ul>
<li><a title="How to deploy WordPress using the Windows Azure SDK for PHP scaffold" href="http://azurephp.interoperabilitybridges.com/articles/how-to-deploy-wordpress-using-the-windows-azure-sdk-for-php-wordpress-scaffold" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fhow-to-deploy-wordpress-using-the-windows-azure-sdk-for-php-wordpress-scaffold','How+to+deploy+WordPress+using+the+Windows+Azure+SDK+for+PHP+scaffold')" target="_blank">How to deploy WordPress using the Windows Azure SDK for PHP scaffold</a></li>
<li><a title="How to deploy WordPress Multisite to Windows Azure using the WordPress scaffold" href="http://azurephp.interoperabilitybridges.com/articles/how-to-deploy-wordpress-multisite-to-windows-azure-using-the-wordpress-scaffold" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fhow-to-deploy-wordpress-multisite-to-windows-azure-using-the-wordpress-scaffold','How+to+deploy+WordPress+Multisite+to+Windows+Azure+using+the+WordPress+scaffold')" target="_blank">How to deploy WordPress Mulisite to Windows Azure using the WordPress scaffold</a></li>
</ul>
<h2>Windows Azure Helper for WordPress</h2>
<p>The <a title="Windows Azure Helper for WordPress plugin" href="http://wordpress.org/extend/plugins/windows-azure-helper/" onclick="return TrackClick('http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwindows-azure-helper%2F','Windows+Azure+Helper+for+WordPress+plugin')" target="_blank">Windows Azure Helper for WordPress</a> is a very simple plugin that helps site administrators by adding or removing features that users should not have access to changing on a site running in Windows Azure.</p>
<p>The features list on the plugin page list the following (as of publishing this post):</p>
<p>Features</p>
<ul>
<li>Hide the Updates menu item under Dashboard</li>
<li>Hide the Add new plugin menu item under Plugins</li>
<li>Hide the Permalinks menu item under Settings</li>
</ul>
<h2>WP DB Abstraction</h2>
<p>If you want to use SQL Server for any reason, this is the plugin to have. Any WordPress install, whether on Windows Azure or not, can take advantage of existing (maybe corporate) database servers. When hosting in Windows Azure you will be using SQL Azure, which is SQL Server "in the cloud".</p>
<p>The <a title="WordPress WP DB Abstraction plugin" href="http://wordpress.org/extend/plugins/wordpress-database-abstraction/" onclick="return TrackClick('http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwordpress-database-abstraction%2F','WordPress+WP+DB+Abstraction+plugin')" target="_blank">WP DB Abstraction plugin</a> can be found in the WordPress repository.</p>
<h2>Windows Azure Storage for WordPress</h2>
<p>If you wish to take advantage of the massive cloud storage available in Windows Azure, or easily add content to the Windows Azure CDN, this plugin will help you do just that. With this plugin you can redirect file uploads to Windows Azure storage completely transparently to the user. A must have if you host on Windows Azure due to the non-shared nature of the cloud instances drives.</p>
<p>The <a title="Windows Azure Storage for WordPress" href="http://wordpress.org/extend/plugins/windows-azure-storage/" onclick="return TrackClick('http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwindows-azure-storage%2F','Windows+Azure+Storage+for+WordPress')" target="_blank">Windows Azure Storage for WordPress</a> plugin can be found in the WordPress repository.</p>
<h2>Windows Azure Developer Library</h2>
<p>The real meat and potatoes of this post is the <a title="Windows Azure Developer Library" href="http://wordpress.org/extend/plugins/windows-azure-developer-library/" onclick="return TrackClick('http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwindows-azure-developer-library%2F','Windows+Azure+Developer+Library')" target="_blank">Windows Azure Developer Library</a>. This plugin adds the library from the <a title="Windows Azure SDK for PHP" href="http://phpazure.codeplex.com/" onclick="return TrackClick('http%3A%2F%2Fphpazure.codeplex.com%2F','Windows+Azure+SDK+for+PHP')" target="_blank">Windows Azure SDK for PHP</a> to WordPress. Upon activation, developers will have access to all the features provided by the Windows Azure SDK for PHP in their plugins. The Microsoft Interoperability team maintains a great list of tutorials on the Azure PHP website to help developers, code examples included.</p>
<p>Be sure to check out the <a title="Windows Azure PHP tutorials" href="http://azurephp.interoperabilitybridges.com/tutorials" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Ftutorials','Windows+Azure+PHP+tutorials')" target="_blank">Azure PHP tutorials</a> page for updates as this list may be out of date</p>
<div>
<h3><strong><a title="Get Started" href="http://azurephp.interoperabilitybridges.com/get-started" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Fget-started','Get+Started')">Get Started</a></strong></h3>
<ul>
<li>Setup the Windows Azure Development Environment
<ul>
<li><a title="Setup the Windows Azure Development Environment automatically with the Microsoft Web Platform Installer" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-development-environment-automatically-with-the-microsoft-web-platform-installer" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fsetup-the-windows-azure-development-environment-automatically-with-the-microsoft-web-platform-installer','Setup+the+Windows+Azure+Development+Environment+automatically+with+the+Microsoft+Web+Platform+Installer')"> Automatically with the Microsoft Web Platform Installer</a></li>
<li><a title="Setup the Windows Azure Development Environment manually" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-development-environment-manually" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fsetup-the-windows-azure-development-environment-manually','Setup+the+Windows+Azure+Development+Environment+manually')">Manually</a></li>
</ul>
</li>
<li><a title="Setup the Windows Azure SDK for PHP" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-sdk-for-php" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fsetup-the-windows-azure-sdk-for-php','Setup+the+Windows+Azure+SDK+for+PHP')">Setup the Windows Azure SDK for PHP</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/obtaining-the-sample-files-used-in-the-tutorials" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fobtaining-the-sample-files-used-in-the-tutorials','Obtaining+the+sample+files+used+in+the+tutorials')">Obtaining the sample files used in the tutorials</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/build-and-deploy-a-windows-azure-php-application" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fbuild-and-deploy-a-windows-azure-php-application','Build+and+deploy+a+Windows+Azure+PHP+application')">Build and deploy a Windows Azure PHP application</a></li>
<li><a title="Using the Windows Azure SDK for PHP" href="http://azurephp.interoperabilitybridges.com/articles/using-the-windows-azure-sdk-for-php" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fusing-the-windows-azure-sdk-for-php','Using+the+Windows+Azure+SDK+for+PHP')">Using the Windows Azure SDK for PHP</a></li>
</ul>
<h3><strong>Using the Command Line Tools</strong></h3>
<ul>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/packaging-applications" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fpackaging-applications','Packaging+Applications')">Packaging Applications</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/using-scaffolds" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fusing-scaffolds','Using+Scaffolds')">Using Scaffolds</a></li>
</ul>
<h3><strong>Windows Azure Storage</strong></h3>
<ul>
<li><a title="Tutorial - Using Table Storage" href="http://azurephp.interoperabilitybridges.com/articles/tutorial-using-table-storage" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Ftutorial-using-table-storage','Tutorial+-+Using+Table+Storage')">Using Table storage</a></li>
<li><a title="Tutorial - Using Blob Storage" href="http://azurephp.interoperabilitybridges.com/articles/tutorial-using-blob-storage" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Ftutorial-using-blob-storage','Tutorial+-+Using+Blob+Storage')">Using Blob storage</a></li>
<li><a title="Tutorial - Using Queue Service" href="http://azurephp.interoperabilitybridges.com/articles/tutorial-using-queue-service" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Ftutorial-using-queue-service','Tutorial+-+Using+Queue+Service')">Using Queue storage</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/sharing-private-blobs" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fsharing-private-blobs','Sharing+private+blobs')">Sharing private blobs</a></li>
</ul>
<h3><strong>Windows Azure</strong></h3>
<ul>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/enable-remote-desktop" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fenable-remote-desktop','Enable+Remote+Desktop')">Enable Remote Desktop</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/diagnostics%E2%80%93part-i" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fdiagnostics%25E2%2580%2593part-i','Diagnostics+--+Part+I')">Diagnostics -- Part I</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/diagnostics%E2%80%93part-ii" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fdiagnostics%25E2%2580%2593part-ii','Diagnostics+--+Part+II')">Diagnostics -- Part II</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/resources-for-building-scalable-php-applications-on-windows-azure" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fresources-for-building-scalable-php-applications-on-windows-azure','Scaling+PHP+Applications')"> Scaling PHP Applications</a>
<ul>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/scaling-php-applications-on-windows-azure-part-i-performance-metrics" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fscaling-php-applications-on-windows-azure-part-i-performance-metrics','Performance+Metrics')"> Performance Metrics</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/scaling-php-applications-on-windows-azure-part-ii-role-management" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fscaling-php-applications-on-windows-azure-part-ii-role-management','Role+Management')"> Role Management</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/scaling-php-applications-on-windows-azure-part-iii-performance-monitor" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fscaling-php-applications-on-windows-azure-part-iii-performance-monitor','Performance+Monitor')"> Performance Monitor</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/scaling-php-applications-on-windows-azure-part-iv-using-worker-roles-for-automated-scaling" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fscaling-php-applications-on-windows-azure-part-iv-using-worker-roles-for-automated-scaling','Automated+Scaling+with+Worker+Roles')"> Automated Scaling with Worker Roles</a></li>
</ul>
</li>
<li><a title="Accessing Service Configuration settings from PHP" href="http://azurephp.interoperabilitybridges.com/articles/accessing-service-configuration-values-from-php" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Faccessing-service-configuration-values-from-php','Accessing+Service+Configuration+settings+from+PHP')">Accessing Service Configuration Settings from PHP</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/using-a-custom-php-installation" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fusing-a-custom-php-installation','Using+a+custom+PHP+installation')">Using a custom PHP installation</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/handling-sessions-with-table-storage" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fhandling-sessions-with-table-storage','Handling+sessions+with+Table+storage')">Handling sessions with Table storage</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/handling-sessions-with-sql-azure" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fhandling-sessions-with-sql-azure','Handling+sessions+with+SQL+Azure+storage')">Handling sessions with SQL Azure storage</a></li>
</ul>
<h3><strong>Deploying to Windows Azure</strong></h3>
<ul>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/deploying-your-first-php-application-to-windows-azure#new_deploy" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fdeploying-your-first-php-application-to-windows-azure%23new_deploy','Using+the+Windows+Azure+Portal')"> Using the Windows Azure Portal</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/deploying-your-first-php-application-to-windows-azure#old_deploy" onclick="return TrackClick('http%3A%2F%2Fazurephp.interoperabilitybridges.com%2Farticles%2Fdeploying-your-first-php-application-to-windows-azure%23old_deploy','Using+the+legacy+Windows+Azure+Portal')"> Using the legacy Windows Azure Portal</a></li>
</ul>
</div>
<h2>Automated scaling</h2>
<p>I hear that there is a plugin in the works (maybe because I am one of the devs <img src='http://ben.lobaugh.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) that gives site admins the ability to set various trigger points (CPU, Memory, Network, etc) to have WordPress automagically start up more instances to handle extra traffic, or remove instances when traffic is low to save costs. If you are interested in testing this plugin please let me know.</p>
<h2>Happy developing!</h2>
<p>You now have all the resources you need to start taking advantage of the resources provided by Windows Azure from within WordPress.</p>
<p>If you have any question or would like help developing your Windows Azure WordPress applications feel free to drop myself or the <a title="Microsoft Interoperability Team contact page" href="http://www.interoperabilitybridges.com/contactus" onclick="return TrackClick('http%3A%2F%2Fwww.interoperabilitybridges.com%2Fcontactus','Microsoft+Interoperability+Team+contact+page')" target="_blank">Microsoft Interoperability team</a> a line.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/11491/developing-for-windows-azure-in-wordpress/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Camera+ vs Regular iPhone 4 camera</title>
		<link>http://ben.lobaugh.net/blog/8967/camera-vs-regular-iphone-camera</link>
		<comments>http://ben.lobaugh.net/blog/8967/camera-vs-regular-iphone-camera#comments</comments>
		<pubDate>Mon, 19 Mar 2012 00:34:46 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=8967</guid>
		<description><![CDATA[I have been using Camera+here and there for several weeks. Mostly I have used some of the enhancement filters to make a few photos look better on my iPhone 4 before emailing them to someone. A couple days ago I took the photo on the left, not too bad. Then I ran it through the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using <a title="Camera+" href="http://campl.us/" onclick="return TrackClick('http%3A%2F%2Fcampl.us%2F','Camera%2B')" target="_blank">Camera+</a>here and there for several weeks. Mostly I have used some of the enhancement filters to make a few photos look better on my iPhone 4 before emailing them to someone. A couple days ago I took the photo on the left, not too bad. Then I ran it through the clarity filter in Camera+ to come up with the photo on the right. Much better. It could still be better, but on a 4 megapixel phone camera with a tiny sensor it is not too shabby.</p>
<p>Click to make the photos larger</p>
<div id="attachment_8970" class="wp-caption alignright" style="width: 300px"><a href="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/prelim_setup.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F03%2Fprelim_setup.jpg','Photo+processed+with+Camera%2B')"><img class=" wp-image-8970     " title="Photo processed with Camera+" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/prelim_setup-358x480.jpg" alt="Photo processed with Camera+" width="290" /></a><p class="wp-caption-text">Photo processed with Camera+</p></div>
<div id="attachment_8971" class="wp-caption alignleft" style="width: 300px"><a href="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/no_edit2.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F03%2Fno_edit2.jpg','Original+iPhone+photo')"><img class=" wp-image-8971     " title="Original iPhone photo" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/no_edit2-358x480.jpg" alt="Original iPhone photo" width="290" /></a><p class="wp-caption-text">Original iPhone photo</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/8967/camera-vs-regular-iphone-camera/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Add or remove user contact methods in user profiles</title>
		<link>http://ben.lobaugh.net/blog/9064/wordpress-add-or-remove-user-contact-methods-in-user-profiles</link>
		<comments>http://ben.lobaugh.net/blog/9064/wordpress-add-or-remove-user-contact-methods-in-user-profiles#comments</comments>
		<pubDate>Wed, 14 Mar 2012 19:58:34 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=9064</guid>
		<description><![CDATA[This post goes along with a presentation I gave at the February Seattle WordPress Developers Meetup. The Seattle WordPress group is pretty amazing and I highly recommend joining if you have the opportunity. Get the slides and code If you would like to view the slides used during the presentation they are available as a [...]]]></description>
			<content:encoded><![CDATA[<p>This post goes along with a presentation I gave at the <a title="February Seattle WordPress Developers Meetup" href="http://www.meetup.com/SeattleWordPressMeetup/events/48917872/" onclick="return TrackClick('http%3A%2F%2Fwww.meetup.com%2FSeattleWordPressMeetup%2Fevents%2F48917872%2F','February+Seattle+WordPress+Developers+Meetup')" target="_blank">February Seattle WordPress Developers Meetup</a>. The <a title="Seattle WordPress Meetup group" href="http://www.meetup.com/SeattleWordPressMeetup/" onclick="return TrackClick('http%3A%2F%2Fwww.meetup.com%2FSeattleWordPressMeetup%2F','Seattle+WordPress+Meetup+group')" target="_blank">Seattle WordPress</a> group is pretty amazing and I highly recommend joining if you have the opportunity.</p>
<h2>Get the slides and code</h2>
<p>If you would like to view the slides used during the presentation they are available as a PDF below:</p>
<p><a href="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/blobaugh-Feb2012-Extending_WordPress_User_Profiles1.pdf" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F03%2Fblobaugh-Feb2012-Extending_WordPress_User_Profiles1.pdf','blobaugh-Feb2012-Extending_WordPress_User_Profiles')">blobaugh-Feb2012-Extending_WordPress_User_Profiles</a></p>
<p>The complete code from this presentation can be found on the Seattle WordPress Github account</p>
<p><a title="WordPress Seattle Github" href="https://github.com/WordPress-Seattle/PresentationSource/blob/master/Feb2012-wpseaUserProfile/wpseaUserProfile.php" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FWordPress-Seattle%2FPresentationSource%2Fblob%2Fmaster%2FFeb2012-wpseaUserProfile%2FwpseaUserProfile.php','WordPress+Seattle+Github')" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FWordPress-Seattle%2FPresentationSource%2Fblob%2Fmaster%2FFeb2012-wpseaUserProfile%2FwpseaUserProfile.php','WordPress+Seattle+Github')" target="_blank">https://github.com/WordPress-Seattle</a></p>
<h2>Synopsis</h2>
<p>There are several built-in user contact methods that are already available on user profiles in WordPress, however the services there are not very widely used today. The built-in contact methods are: AIM, Yahoo IM, and Jabber. Of the three AIM and Yahoo IM are rarely used today, and most general audiences do not know what Jabber is (Jabber is pretty awesome and has wide ranges of uses. Google, for instance, uses Jabber for their chat network). More people today are using services such as Twitter or Facebook, or LinkedIn, so it probably makes sense to update the list of contact methods with whichever are most correct for your site.</p>
<p>What this post will show you is how to tap into the user profile to get rid of unneeded contact methods and add a new one for a user's Twitter handle. Additionally, when we are done each post will show the post author information box below the content. This is to highlight how easy it is to use the new contact methods to display on the frontend.</p>
<h2>Filters</h2>
<p>Recall that filters are similar to hooks, except that filters are designed to alter output instead of trigger an event. For our purposes we will be tapping into two filters, one which will allow us access to the user's contact methods and the other to post content.</p>
<p>We will be using the following two filters:</p>
<ul>
<li><a title="Codex Filter Reference: user_contactmethods" href="http://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FFilter_Reference%2Fuser_contactmethods','Codex+Filter+Reference%3A+user_contactmethods')" target="_blank">user_contactmethods</a><br />
Holds a list of contact methods on a profile</li>
<li><a title="WordPress Codex Filter Reference: the_content" href="http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FFilter_Reference%2Fthe_content','WordPress+Codex+Filter+Reference%3A+the_content')" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FFilter_Reference%2Fthe_content','WordPress+Codex+Filter+Reference%3A+the_content')" target="_blank">the_content</a><br />
Holds the content of a post</li>
</ul>
<h2>Setup the user_contactmethods filter</h2>
<p>Filters are easily created using the <a title="WordPress Codex Function Reference: add_filter()" href="http://codex.wordpress.org/Function_Reference/add_filter" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FFunction_Reference%2Fadd_filter','WordPress+Codex+Function+Reference%3A+add_filter%28%29')" target="_blank">add_filter()</a> function. This function takes several arguments, however will are only focusing on the first two, which are the WordPress filter name and the name of our custom function to send the filter to. Setup the filter with the following code:</p>
<pre class="php">add_filter<span style="color: #66cc66;">&#40;</span> ‘user_contactmethods’, ‘wpsea_setup_user_profile’ <span style="color: #66cc66;">&#41;</span>;</pre>
<p>When calling our custom function, wpsea_setup_user_profile(), a variable containing an array of the available contact methods will be passed.</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">function</span> wpsea_setup_user_profile <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></pre>
<p>By default the following exist: AIM, Yahoo Messenger, Jabber</p>
<h2>Remove unused contact methods</h2>
<p>Contact methods are stored in the passed in parameter, which is an array, and can be removed using the built-in PHP method to remove array elements, unset(). None of the existing contact methods are needed so let’s get rid of them all:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">function</span> func_name <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <a href="http://www.php.net/unset"><span style="color: #000066;">unset</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span><span style="color: #66cc66;">&#91;</span>‘aim’<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
    <a href="http://www.php.net/unset"><span style="color: #000066;">unset</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span><span style="color: #66cc66;">&#91;</span>‘yim’<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
    <a href="http://www.php.net/unset"><span style="color: #000066;">unset</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span><span style="color: #66cc66;">&#91;</span>‘jabber’<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<h2>Add a new contact method</h2>
<p>This is the really complex part, adding a new contact method (sarcasm). The WordPress core developers have made this very easy on us by providing the user contact methods as an array. To create a new one just create a new, uniquely named, element in the array and viola, a new user contact field will show when editing the user's profile. Make sure to pick something that makes sense when naming the array element.</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">function</span> wpsea_setup_user_profile <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user_contactmethods</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$user_contactmethods</span><span style="color: #66cc66;">&#91;</span>‘twitter’<span style="color: #66cc66;">&#93;</span> = ‘Twitter Handle’;
<span style="color: #66cc66;">&#125;</span></pre>
<h2>Take a peek</h2>
<p>If we have done everything correctly you should now be able to activate the plugin and see the changes you made on your profile</p>
<p><a href="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/wp_user_contact_methods.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F03%2Fwp_user_contact_methods.jpg','wp_user_contact_methods')"><img class="wp-image-9071 alignnone" style="border: 1px solid black;" title="wp_user_contact_methods" src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/03/wp_user_contact_methods-600x166.jpg" alt="" width="600" height="166" /></a></p>
<h2>Move to the front</h2>
<p>Well, we have our backend all spiffed up now with the new contact methods, but unless users only look at profiles from within the backend you will probably be wanting to know how to show your new contact method to visitors on the frontend, this is quite simple. If you are following along with my presentation slides you will notice that I am going to diverge here. The slides explain the various functions used to create our author information box, however I am skipping that here and getting right down to the code.</p>
<p>The <a title="WordPress Codex Function Reference: get_the_author_meta" href="http://codex.wordpress.org/Function_Reference/get_the_author_meta" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FFunction_Reference%2Fget_the_author_meta','WordPress+Codex+Function+Reference%3A+get_the_author_meta')">get_the_author_meta()</a> function allows frontend developers and designers access to any of the user's profile fields. get_the_author_meta is usually used within <a title="WordPress Codex Manual: The Loop" href="http://codex.wordpress.org/The_Loop" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FThe_Loop','WordPress+Codex+Manual%3A+The+Loop')" target="_blank">The Loop</a> and gets the current post author automagically, however it can be used anywhere and an optional user id supplied. For our purposes we will be using code similar to:</p>
<pre class="php"><span style="color: #0000ff;">$twitter_handle</span> = get_the_author_meta<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'twitter'</span> <span style="color: #66cc66;">&#41;</span>;</pre>
<p>Now we need to setup a filter for <a title="WordPress Codex Filter Reference: the_content" href="http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FFilter_Reference%2Fthe_content','WordPress+Codex+Filter+Reference%3A+the_content')" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FFilter_Reference%2Fthe_content','WordPress+Codex+Filter+Reference%3A+the_content')" target="_blank">the_content</a>, which is done with the following line of code:</p>
<pre class="php">add_filter<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'the_content'</span>, <span style="color: #ff0000;">'wpsea_post_user_profile'</span> <span style="color: #66cc66;">&#41;</span>;</pre>
<p>The rest of the code I will give you in a dump because it is regular display code that should make sense to you already, if not check the <a title="WordPress Codex" href="http://codex.wordpress.org" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org','WordPress+Codex')" target="_blank">Codex</a> or leave a comment and I will add more details.</p>
<pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> wpsea_post_user_profile<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$content</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> !is_singular<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'post'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$content</span>;
&nbsp;
    <span style="color: #0000ff;">$id</span> = get_the_author_meta<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'ID'</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #0000ff;">$s</span> = <span style="color: #ff0000;">'
&lt;div id=&quot;author-bio&quot; style=&quot;border: 1px dotted #000; padding: 5px&quot;&gt;'</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// Author gravatar</span>
    <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'
&lt;div id=&quot;author-avatar&quot; style=&quot;float:left; margin-right: 10px&quot;&gt;'</span> . get_avatar<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$id</span>, <span style="color: #ff0000;">'150'</span> <span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;&lt;/div&gt;
&nbsp;
&quot;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// Author info</span>
    <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'
&lt;div id=&quot;the-author-info&quot; style=&quot;text-align:left; width: 100%&quot;&gt;'</span>;
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$url</span> = get_the_author_meta<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'user_url'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;strong&gt;&lt;a href=&quot;'</span> . <span style="color: #0000ff;">$url</span> . <span style="color: #ff0000;">'&quot;&gt;'</span> . get_the_author<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&lt;/a&gt;&lt;/strong&gt;'</span>;
        <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;strong&gt;'</span> . get_the_author<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&lt;/strong&gt;'</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'
&nbsp;
'</span> . get_the_author_meta<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'description'</span> <span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'
&nbsp;
'</span>;
&nbsp;
        <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;a href=&quot;'</span> . get_author_posts_url<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$id</span> <span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&quot;&gt;All posts by '</span> . get_the_author<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&lt;/a&gt;'</span>;
        <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;br/&gt;&lt;a href=&quot;http://twitter.com/'</span> . get_the_author_meta<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'twitter'</span> <span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&quot;&gt;
               Follow '</span> . get_the_author<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">' on Twitter&lt;/a&gt;'</span>;
&nbsp;
    <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;/div&gt;
&nbsp;
'</span>;
&nbsp;
    <span style="color: #0000ff;">$s</span> .= <span style="color: #ff0000;">'&lt;/div&gt;
&nbsp;
'</span>;
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$content</span> . <span style="color: #0000ff;">$s</span>;
 <span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<h2>Want it all?</h2>
<p>The Seattle WordPress group utilizes Github to share code amongst members and for presentations. You can find this entire file on their Github page</p>
<p><a title="WordPress Seattle Github" href="https://github.com/WordPress-Seattle/PresentationSource/blob/master/Feb2012-wpseaUserProfile/wpseaUserProfile.php" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FWordPress-Seattle%2FPresentationSource%2Fblob%2Fmaster%2FFeb2012-wpseaUserProfile%2FwpseaUserProfile.php','WordPress+Seattle+Github')" onclick="return TrackClick('https%3A%2F%2Fgithub.com%2FWordPress-Seattle%2FPresentationSource%2Fblob%2Fmaster%2FFeb2012-wpseaUserProfile%2FwpseaUserProfile.php','WordPress+Seattle+Github')" target="_blank">https://github.com/WordPress-Seattle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/9064/wordpress-add-or-remove-user-contact-methods-in-user-profiles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I got bored and built a new sailboat&#8230;</title>
		<link>http://ben.lobaugh.net/blog/7208/i-got-bored-and-built-a-new-sailboat</link>
		<comments>http://ben.lobaugh.net/blog/7208/i-got-bored-and-built-a-new-sailboat#comments</comments>
		<pubDate>Mon, 27 Feb 2012 23:54:26 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Randomness]]></category>
		<category><![CDATA[Sailing]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=7208</guid>
		<description><![CDATA[Sitting on the beach in Orange County in weather conditions too perfect almost to even think about tends to make one bored. So I put that restless energy to good use and built myself a new sailboat. I do sorely miss Zippey, but I think Old Dodger will suffice me for the time being. Much [...]]]></description>
			<content:encoded><![CDATA[<p>Sitting on the beach in Orange County in weather conditions too perfect almost to even think about tends to make one bored. So I put that restless energy to good use and built myself a new sailboat. I do sorely miss Zippey, but I think Old Dodger will suffice me for the time being. Much love and preparation went into designing just the right hull lines for that perfect mixture of beauty and homeliness. Maybe you want to join me to a sail to Catalina island?</p>
<p><a href="http://ben.lobaugh.net/blog/wp-content/uploads/2012/02/20120227-155257.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F02%2F20120227-155257.jpg','')"><img class="alignnone " src="http://ben.lobaugh.net/blog/wp-content/uploads/2012/02/20120227-155257.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fblog%2Fwp-content%2Fuploads%2F2012%2F02%2F20120227-155257.jpg','')" alt="20120227-155257.jpg" width="600" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/7208/i-got-bored-and-built-a-new-sailboat/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress: Replace Built-in User Authentication</title>
		<link>http://ben.lobaugh.net/blog/7175/wordpress-replace-built-in-user-authentication</link>
		<comments>http://ben.lobaugh.net/blog/7175/wordpress-replace-built-in-user-authentication#comments</comments>
		<pubDate>Mon, 27 Feb 2012 23:25:23 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=7175</guid>
		<description><![CDATA[Synopsis WordPress is a powerful multi-user web content management system. Due to its multi-user nature, WordPress has long instituted a full fledged user system, complete with separated roles and permissions for each user. What happens, however, when WordPress is brought into an environment with an existing user repository? Out of the box WordPress has no [...]]]></description>
			<content:encoded><![CDATA[<h2>Synopsis</h2>
<p>WordPress is a powerful multi-user web content management system. Due to its multi-user nature, WordPress has long instituted a full fledged user system, complete with separated roles and permissions for each user. What happens, however, when WordPress is brought into an environment with an existing user repository? Out of the box WordPress has no support for interacting with other user authentication methods other than built-in, however there exist WordPress filters that allow developers to hook into WordPress core actions, such as user authentication, registration, etc and alter their logic. In this post I will show you how to replace WordPress' built-in authentication with authentication based off a very simple web service (Which we will also create).</p>
<p>Unless otherwise noted, all development will be assumed to exist at http://localhost for the purposes of this tutorial.</p>
<h2>Now with video!</h2>
<p>Check out the following video of the presentation over this topic I gave at the March of 2012 <a title="Orange County WordPress group" href="http://ocwp.org/" onclick="return TrackClick('http%3A%2F%2Focwp.org%2F','Orange+County+WordPress+group')" target="_blank">Orange County WordPress</a> <a title="Orange County WordPress Meetup page" href="http://www.meetup.com/OC-Wordpress-Group/" onclick="return TrackClick('http%3A%2F%2Fwww.meetup.com%2FOC-Wordpress-Group%2F','Orange+County+WordPress+Meetup+page')" target="_blank">Meetup</a>. While containing lots of good information, it should be used along with the rest of this post, not as a replacement for.</p>
<div class="flowPlayer"><a class="player plain" id="postnum-7175"><embed src="http://ben.lobaugh.net/blog/wp-content/plugins/wordpress-flowplayer/flowplayer-3.0.0.swf" allowfullscreen="true" allowscriptaccess="always" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" id="postnum-7175" bgcolor="#000000" name="postnum-7175" flashvars="config={&quot;clip&quot;:{&quot;url&quot;:&quot;http://ben.lobaugh.net/uploads/presentation_replace_wp_user_auth.flv&quot;,&quot;autoPlay&quot;:false},&quot;playerId&quot;:&quot;postnum-7175&quot;,&quot;playlist&quot;:[{&quot;url&quot;:&quot;http://ben.lobaugh.net/uploads/presentation_replace_wp_user_auth.flv&quot;,&quot;autoPlay&quot;:false}]}" width="640px" height="480px"><br />
			</a><br />
			<script language="javascript">
			("postnum-7175", "http://ben.lobaugh.net/blog/wp-content/plugins/wordpress-flowplayer/flowplayer-3.0.0.swf", {
			clip: {
				url: 'http://ben.lobaugh.net/uploads/presentation_replace_wp_user_auth.flv',
				autoPlay: false
			} 
			});
				</script></div>
<h2>Creating a simple web based authentication service</h2>
<p>We are going to create a simple web based authentication service to use as proof of concept when replacing the built-in WordPress authentication mechanism. Though this service will be simple, it will help illustrate how easy it is to authenticate using other databases, applications, even oAuth. Let's begin.</p>
<p>Create a new PHP file at http://localhost/<strong>auth_serv.php</strong> with the following contents:</p>
<pre class="php"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'user'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #ff0000;">'bob'</span> &amp;amp;&amp;amp; <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'pass'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #ff0000;">'asdf'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> json_encode<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'result'</span> =&amp;gt; <span style="color: #ff0000;">'1'</span>, <span style="color: #ff0000;">'username'</span> =&amp;gt; <span style="color: #ff0000;">'bob'</span>, <span style="color: #ff0000;">'first_name'</span> =&amp;gt; <span style="color: #ff0000;">'Bob'</span>, <span style="color: #ff0000;">'last_name'</span> =&amp;gt; <span style="color: #ff0000;">'Jacobsen'</span>, <span style="color: #ff0000;">'email'</span> =&amp;gt; <span style="color: #ff0000;">'aaben@lobaugh.net'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
    <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> json_encode<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'result'</span> =&amp;gt; <span style="color: #ff0000;">'0'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>The code simply returns a JSON encoded array. This array contains a 'result' element, which is a boolean, holding whether the user is valid or not. This service only support one user with the following credentials:</p>
<p>Username: bob<br />
Password: asdf</p>
<h2>Let's talk filters</h2>
<p>WordPress allows developers to extend and manipulate virtually all of the system through hooks. There are two types of hooks in WordPress, actions and filters. Actions allow developers to tap into the power of WordPress and create new functionality. Filters allow developers to interrupt the flow of WordPress and alter how it runs. For example, there is a filter called 'the_content'. This filter allows plugins to tap into post content before it is displayed and alter it as deemed fit.</p>
<p>For our purposes we will be using the 'authenticate' filter. Whenever a login is triggered the authenticate filter is hit and custom logic can be applied to it. The filter can be setup with the following code.</p>
<pre class="php">add_filter<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'authenticate'</span>, <span style="color: #ff0000;">'demo_auth'</span>, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> demo_auth<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user</span>, <span style="color: #0000ff;">$username</span>, <span style="color: #0000ff;">$password</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$user</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>The demo_auth function will replace the built-in authentication method. The authenticate filter sends along three parameters:</p>
<ul>
<li>$user - A WP_User object.</li>
<li>$username - From the username text box. This parameter is optional</li>
<li>$password - From the password text box. This parameter is optional</li>
</ul>
<p>Because we will be using the built-in login box to obtain a username and password to send to our pretend service we will be using the $username and $password parameter. It is important to note that the username and password parameters are not required for this filter to function properly. Why would you not need a username and password you ask? If you are using oAuth to authenticate against another provider, such as Meetup, that site will provide it's own login form to protect user information.</p>
<h2> What to keep in mind when replacing the built-in authentication</h2>
<p>WordPress relies heavily on it's built-in user system. Because of this there are lots of references to users in the WordPress database that are made. While slightly annoying, it is still fairly simple to work around these limitations.</p>
<p>WordPress requires that a real user (WordPress user) be present in the WordPress database in order to perform operations on that user. Luckily WordPress contains function to create, manipulate, and delete users. So when we build our service we will actually be taking the following steps, which should be fairly authentication type agnostic:</p>
<ul>
<li>Authenticate user via alternate method
<ul>
<li>If invalid user display invalid login message</li>
<li>If valid user
<ul>
<li>Check to see if the user exists in the WordPress user table</li>
<li>If user exists load and return user data in a WP_User object</li>
<li>If user does not exist
<ul>
<li>Automagically create a new user from alternate authentication service user information</li>
<li>After creating the user load and return user data in a WP_User object</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>Enough blabbing, show me the code!</h2>
<p>Here is a quick dump of the code. Then I will walk through the more important pieces</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">function</span> demo_auth<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user</span>, <span style="color: #0000ff;">$username</span>, <span style="color: #0000ff;">$password</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// Make sure a username and password are present for us to work with</span>
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$username</span> == <span style="color: #ff0000;">''</span> || <span style="color: #0000ff;">$password</span> == <span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span>;
&nbsp;
    <span style="color: #0000ff;">$response</span> = wp_remote_get<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;http://localhost/auth_serv.php?user=$username&amp;amp;pass=$password&quot;</span> <span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0000ff;">$ext_auth</span> = json_decode<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$response</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'body'</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'result'</span><span style="color: #66cc66;">&#93;</span>  == <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">// User does not exist,  send back an error message</span>
        <span style="color: #0000ff;">$user</span> = <span style="color: #000000; font-weight: bold;">new</span> WP_Error<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'denied'</span>, __<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&lt;strong&gt;ERROR&lt;/strong&gt;: User/pass bad&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'result'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
         <span style="color: #808080; font-style: italic;">// External user exists, try to load the user info from the WordPress user table</span>
         <span style="color: #0000ff;">$userobj</span> = <span style="color: #000000; font-weight: bold;">new</span> WP_User<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
         <span style="color: #0000ff;">$user</span> = <span style="color: #0000ff;">$userobj</span>-&amp;gt;get_data_by<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'email'</span>, <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'email'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Does not return a WP_User object &lt;img src='http://ben.lobaugh.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /&gt;</span>
         <span style="color: #0000ff;">$user</span> = <span style="color: #000000; font-weight: bold;">new</span> WP_User<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$user</span>-&amp;gt;ID<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// Attempt to load up the user with that ID</span>
&nbsp;
         <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$user</span>-&amp;gt;ID == <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
             <span style="color: #808080; font-style: italic;">// The user does not currently exist in the WordPress user table.</span>
             <span style="color: #808080; font-style: italic;">// You have arrived at a fork in the road, choose your destiny wisely</span>
&nbsp;
             <span style="color: #808080; font-style: italic;">// If you do not want to add new users to WordPress if they do not</span>
             <span style="color: #808080; font-style: italic;">// already exist uncomment the following line and remove the user creation code</span>
             <span style="color: #808080; font-style: italic;">//$user = new WP_Error( 'denied', __(&quot;&lt;strong&gt;ERROR&lt;/strong&gt;: Not a valid user for this system&quot;) );</span>
&nbsp;
             <span style="color: #808080; font-style: italic;">// Setup the minimum required user information for this example</span>
             <span style="color: #0000ff;">$userdata</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'user_email'</span> =&amp;gt; <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'email'</span><span style="color: #66cc66;">&#93;</span>,
                                <span style="color: #ff0000;">'user_login'</span> =&amp;gt; <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'email'</span><span style="color: #66cc66;">&#93;</span>,
                                <span style="color: #ff0000;">'first_name'</span> =&amp;gt; <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#93;</span>,
                                <span style="color: #ff0000;">'last_name'</span> =&amp;gt; <span style="color: #0000ff;">$ext_auth</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'last_name'</span><span style="color: #66cc66;">&#93;</span>
                                <span style="color: #66cc66;">&#41;</span>;
             <span style="color: #0000ff;">$new_user_id</span> = wp_insert_user<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$userdata</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// A new user has been created</span>
&nbsp;
             <span style="color: #808080; font-style: italic;">// Load the new user info</span>
             <span style="color: #0000ff;">$user</span> = <span style="color: #000000; font-weight: bold;">new</span> WP_User <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$new_user_id</span><span style="color: #66cc66;">&#41;</span>;
         <span style="color: #66cc66;">&#125;</span> 
&nbsp;
     <span style="color: #66cc66;">&#125;</span>
&nbsp;
     <span style="color: #808080; font-style: italic;">// Comment this line if you wish to fall back on WordPress authentication</span>
     <span style="color: #808080; font-style: italic;">// Useful for times when the external service is offline</span>
     remove_action<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'authenticate'</span>, <span style="color: #ff0000;">'wp_authenticate_username_password'</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$user</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>Now let's go through some of this code:</p>
<ul>
<li><a title="WordPress Manual for wp_remote_get" href="http://codex.wordpress.org/Function_API/wp_remote_get" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FFunction_API%2Fwp_remote_get','WordPress+Manual+for+wp_remote_get')" target="_blank">wp_remote_get</a>() - WordPress function that will fetch a remote resource with GET.</li>
<li><a title="WordPress Manual for WP_Error" href="http://codex.wordpress.org/Class_Reference/WP_Error" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_Error','WordPress+Manual+for+WP_Error')" target="_blank">WP_Error</a> - WordPress class to handle when errors occur. The authenticate filter automagically checks WP_Error before allowing login to continue</li>
<li><a title="WordPress Manual for WP_User" href="http://codex.wordpress.org/Class_Reference/WP_User" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_User','WordPress+Manual+for+WP_User')" target="_blank">WP_User</a> - The WordPress User Class allows accessing properties, roles and capabilities of a specific user.</li>
<li><a title="WordPress Manual for wp_insert_user" href="http://codex.wordpress.org/Function_Reference/wp_insert_user" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FFunction_Reference%2Fwp_insert_user','WordPress+Manual+for+wp_insert_user')" target="_blank">wp_insert_user</a> - Inserts a new user into the WordPress database based on the passed in user fields</li>
</ul>
<p>The remove_action line is of particular importance. If that line exists WordPress will only authenticate based on the external service. If that line were to be commented out WordPress would fall back on the local user table for authentication if external authentication fails.</p>
<h3>Additional considerations</h3>
<p>WordPress contains several additional hooks that may be important to know about in your situation:</p>
<ul>
<li><a title="WordPress Manual for lost_password action" href="http://codex.wordpress.org/Plugin_API/Action_Reference/lost_password" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FAction_Reference%2Flost_password','WordPress+Manual+for+lost_password+action')" target="_blank">lost_password</a> - This action allows you to alter how WordPress retrieves lost passwords. If passwords may only be retrieved from the external service developers can use this hook to send users to that service to set a new password</li>
<li><a title="WordPress Manual for user_register action" href="http://codex.wordpress.org/Plugin_API/Action_Reference/user_register" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FAction_Reference%2Fuser_register','WordPress+Manual+for+user_register+action')" target="_blank">user_register</a> - Provides access to the user's data after registration. If the external authentication service allows new users to be posted to it this hook will enable developers to easily push the information out</li>
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/register_form" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FAction_Reference%2Fregister_form','register_form')" target="_blank">register_form</a> - Allows developers to extend the user registration form</li>
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/retrieve_password" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FAction_Reference%2Fretrieve_password','retrieve_password')" target="_blank">retrieve_password</a> - Helps with lost passwords</li>
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/password_reset" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org%2FPlugin_API%2FAction_Reference%2Fpassword_reset','password_reset')" target="_blank">password_reset</a> - Helps with lost passwords</li>
</ul>
<p>In this demo we checked to see if a user exists in WordPress based on the email supplied by the authentication provider, but what happens if that user were to change their email address on the provider's side? Suddenly they would lose all their information stored in the WordPress site, which could include access to all posts and settings. Make sure that whatever method you chose makes sense for your audience and usage patterns. Bad things happen when users think their data has been lost...</p>
<p>And more importantly, what will happen if/when the external provider goes offline? Maybe your service relies on other resources from the external provider and it is ok for your site to be down when theirs is. Generally though you will probably want your service to stay up. If this is the case then you will probably not want to have the remove_action line in the code above. Removing that line will allow WordPress to fallback on it's own user system. However, since most external authentication systems purposefully do not send back a user's password you may need to have the user reset their password on your system, or even when their user is first created have them insert an "emergency" pin to access your site when the external provider is down.</p>
<h2>Helpful links</h2>
<p>I found the following links helpful while researching this topic. If I do not make sense maybe they will</p>
<ul>
<li><a href="http://www.johnkolbert.com/wordpress/how-to-add-your-own-authentication-criteria/" onclick="return TrackClick('http%3A%2F%2Fwww.johnkolbert.com%2Fwordpress%2Fhow-to-add-your-own-authentication-criteria%2F','http%3A%2F%2Fwww.johnkolbert.com%2Fwordpress%2Fhow-to-add-your-own-authentication-criteria%2F')" target="_blank">http://www.johnkolbert.com/wordpress/how-to-add-your-own-authentication-criteria/</a></li>
<li><a href="http://www.blackbam.at/blackbams-blog/2011/06/09/wordpress-custom-external-authentication-loginlogout-php-script/" onclick="return TrackClick('http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F06%2F09%2Fwordpress-custom-external-authentication-loginlogout-php-script%2F','http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F06%2F09%2Fwordpress-custom-external-authentication-loginlogout-php-script%2F')" target="_blank">http://www.blackbam.at/blackbams-blog/2011/06/09/wordpress-custom-external-authentication-loginlogout-php-script/</a></li>
<li><a href="http://willnorris.com/2009/03/authentication-in-wordpress-28" onclick="return TrackClick('http%3A%2F%2Fwillnorris.com%2F2009%2F03%2Fauthentication-in-wordpress-28','http%3A%2F%2Fwillnorris.com%2F2009%2F03%2Fauthentication-in-wordpress-28')" target="_blank">http://willnorris.com/2009/03/authentication-in-wordpress-28</a></li>
<li><a href="http://codex.wordpress.org" onclick="return TrackClick('http%3A%2F%2Fcodex.wordpress.org','http%3A%2F%2Fcodex.wordpress.org')" target="_blank">http://codex.wordpress.org</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/7175/wordpress-replace-built-in-user-authentication/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://ben.lobaugh.net/uploads/presentation_replace_wp_user_auth.flv" length="110363455" type="video/x-flv" />
		</item>
		<item>
		<title>Crystal Cove, my new favorite beach</title>
		<link>http://ben.lobaugh.net/blog/7189/crystal-cove-my-new-favorite-beach</link>
		<comments>http://ben.lobaugh.net/blog/7189/crystal-cove-my-new-favorite-beach#comments</comments>
		<pubDate>Sun, 26 Feb 2012 22:25:51 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Nature]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=7189</guid>
		<description><![CDATA[Crystal Cove is in Orange County, California. I saw it a couple times driving past and decided it needed further investigation. This beach is away from all commercial areas and has no parking lot near it. There is a one mile hike to get it. The sand feels good and the ocean is a gorgeous [...]]]></description>
			<content:encoded><![CDATA[<p>Crystal Cove is in Orange County, California. I saw it a couple times driving past and decided it needed further investigation. This beach is away from all commercial areas and has no parking lot near it. There is a one mile hike to get it. The sand feels good and the ocean is a gorgeous deep blue color. Due to it's secluded nature not many people are around, which increased my enjoyment many times over. If you want to get out and enjoy a beach in peace this is the place to go.</p>
<div class="wp-caption alignnone" style="width: 610px"><a href="http://ben.lobaugh.net/uploads/crystal_cove.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fuploads%2Fcrystal_cove.jpg','Crystal+Cove')"><img class=" " title="Crystal Cove" src="http://ben.lobaugh.net/uploads/crystal_cove.jpg" onclick="return TrackClick('http%3A%2F%2Fben.lobaugh.net%2Fuploads%2Fcrystal_cove.jpg','Crystal+Cove')" alt="Crystal Cove" width="600" /></a><p class="wp-caption-text">Crystal Cove</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/7189/crystal-cove-my-new-favorite-beach/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Strip number from string</title>
		<link>http://ben.lobaugh.net/blog/7168/php-strip-number-from-string</link>
		<comments>http://ben.lobaugh.net/blog/7168/php-strip-number-from-string#comments</comments>
		<pubDate>Sun, 12 Feb 2012 05:35:09 +0000</pubDate>
		<dc:creator>blobaugh</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ben.lobaugh.net/blog/?p=7168</guid>
		<description><![CDATA[I recently ran across a situation where a string being used as a key contained numeric characters. The requirements specified stated that the new data structure keys do not contain numbers. This is a very simple problem to solve and can be done with a simple PHP str_replace. The following function is what I came [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran across a situation where a string being used as a key contained numeric characters. The requirements specified stated that the new data structure keys do not contain numbers. This is a very simple problem to solve and can be done with a simple PHP str_replace. The following function is what I came up with.</p>
<pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> trim_numbers<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$str</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$n</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'0'</span>, <span style="color: #ff0000;">'1'</span>, <span style="color: #ff0000;">'2'</span>, <span style="color: #ff0000;">'3'</span>, <span style="color: #ff0000;">'4'</span>, <span style="color: #ff0000;">'5'</span>, <span style="color: #ff0000;">'6'</span>, <span style="color: #ff0000;">'7'</span>, <span style="color: #ff0000;">'8'</span>, <span style="color: #ff0000;">'9'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #b1b100;">return</span> <a href="http://www.php.net/str_replace"><span style="color: #000066;">str_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$n</span>, <span style="color: #ff0000;">''</span>, <span style="color: #0000ff;">$str</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://ben.lobaugh.net/blog/7168/php-strip-number-from-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

