<?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>superfancy &#187; Codex</title>
	<atom:link href="http://superfancy.net/tag/codex/feed/" rel="self" type="application/rss+xml" />
	<link>http://superfancy.net</link>
	<description>version .02: slowly getting there</description>
	<lastBuildDate>Thu, 13 May 2010 05:22:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple customization of Wordpress Sidebar Login Plugin</title>
		<link>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/</link>
		<comments>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:49:08 +0000</pubDate>
		<dc:creator>Stevie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Sidebar Login]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.steviebenge.com/?p=128</guid>
		<description><![CDATA[I came across this great Wordpress plugin yesterday called Sidebar Login. Like the name says, it lets you place a login form in your WordPress sidebar so you can bypass the typical WP login screen. I thought the plugin would be a nice addition to a site I&#8217;m finishing up at work. Here&#8217;s what it [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this great <a href="http://wordpress.org">Wordpress</a> plugin yesterday called <a href="http://wordpress.org/extend/plugins/sidebar-login/">Sidebar Login</a>. Like the name says, it lets you place a login form in your WordPress sidebar so you can bypass the typical WP login screen. I thought the plugin would be a nice addition to a site I&#8217;m finishing up at work. Here&#8217;s what it looks like on my site:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-1.png" alt="" title="Default Login Screen" width="269" height="263" class="alignnone size-full wp-image-129" /><br />
<span id="more-128"></span><br />
It pretty much works as advertised. Like most WP plugins it&#8217;s easy to install and activate. To bring it up in your sidebar, you use the nifty template tag:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php sidebarlogin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Simple enough. Though it does have one quirk I&#8217;d like to point out. When you login with Sidebar Login, it has a pleasant &#8220;welcome&#8221; greeting, followed by your Username. Like so:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-2.png" alt="" title="Greeting" width="266" height="149" class="alignnone size-full wp-image-130" /></p>
<p>Kinda silly, huh? I think a better behavior for this would be to to use your &#8220;Display Name&#8221; so it&#8217;s a bit more personalized. So instead of in my case displaying &#8220;Admin,&#8221; it&#8217;ll display &#8220;Stevie,&#8221; which I have setup in the WP Dashboard:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-3.png" alt="" title="Display Name" width="370" height="58" class="alignnone size-full wp-image-131" /></p>
<p>All it takes is a little consultation with the WordPress Codex to produce this helpful document, <a href="http://codex.wordpress.org/Function_Reference/get_userdata">Function Reference/get userdata</a> to find the info we need. </p>
<p>In the code to the plugin, on or around Line 26 there you&#8217;ll find this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$before_title</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Welcome &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$user_info</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_login</span>  <span style="color: #339933;">.</span><span style="color: #000088;">$after_title</span><span style="color: #339933;">;</span></pre></div></div>

<p>What we need to do is change <code>$user_info->user_login</code> to use <code>$user_info->display_name</code>. Here is the complete revised line:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$before_title</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Welcome &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$user_info</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display_name</span>  <span style="color: #339933;">.</span><span style="color: #000088;">$after_title</span><span style="color: #339933;">;</span></pre></div></div>

<p>Enacting this change will now display your &#8220;Display Name&#8221; after you login. Problem solved:</p>
<p><img src="http://www.steviebenge.com/wp-content/uploads/2008/09/picture-4.png" alt="" title="Greeting" width="265" height="147" class="alignnone size-full wp-image-132" /></p>
<p>The documentation for this plugin is not very complete so I did a <a href="http://www.google.com">Google</a> search to see if others had this quandary. Much to my surprise I didn&#8217;t find anything so I thought I&#8217;d share what worked for me.</p>
<p>Thanks to the documentation at the WP Codex and reading through some PHP code, it was a quick solution. Take a look at the <a href="http://codex.wordpress.org/Function_Reference/get_userdata">document</a> at <a href="http://codex.wordpress.org/Main_Page">WP Codex</a> to further experiment with your greeting.</p>
<p>Also thanks to <a href="http://blue-anvil.com/about">Mike Jolley</a> and his excellent <a href="http://blue-anvil.com/archives/wordpress-sidebar-login-2-optimised-for-wordpress-26">Sidebar Login</a> plugin!</p>
<p><strong>Update 4/20/2009:</strong><br />
Sidebar Login has been updated so it now uses &#8220;Display Name&#8221; by default.</p>
]]></content:encoded>
			<wfw:commentRss>http://superfancy.net/coding/simple-customization-wordpress-sidebar-login-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
