<?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>bavotasan.com &#187; user</title>
	<atom:link href="http://bavotasan.com/tag/user/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +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>Adding Extra Fields to the WordPress User Profile</title>
		<link>http://bavotasan.com/2009/adding-extra-fields-to-the-wordpress-user-profile/</link>
		<comments>http://bavotasan.com/2009/adding-extra-fields-to-the-wordpress-user-profile/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 17:23:54 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bit]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[info]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[Profile]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1578</guid>
		<description><![CDATA[By default WordPress offers some great options. Whenever a member joins, they have the ability to add more information about themselves, such as a Web site URL, a short bio and their AIM. You might require a bit more info from your members and creating extra fields in the user profile is pretty straightforward. With [...]]]></description>
			<content:encoded><![CDATA[<p>By default WordPress offers some great options. Whenever a member joins, they have the ability to add more information about themselves, such as a Web site URL, a short bio and their AIM. You might require a bit more info from your members and creating extra fields in the user profile is pretty straightforward.<br />
<span id="more-1578"></span><br />
With the following code, you can add some extra fields asking your members for their address. Just add the code t your theme&#8217;s <code>functions.php</code> file, or create a <code>functions.php</code> file if you don&#8217;t already have one.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'show_user_profile'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'extra_user_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user_profile'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'extra_user_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> extra_user_profile_fields<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h3&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Extra profile information&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;blank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
&nbsp;
&lt;table class=&quot;form-table&quot;&gt;
&lt;tr&gt;
&lt;th&gt;&lt;label for=&quot;address&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Address&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;address&quot; id=&quot;address&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'address'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
&lt;span class=&quot;description&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter your address.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;&lt;label for=&quot;city&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;City&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;city&quot; id=&quot;city&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'city'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
&lt;span class=&quot;description&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter your city.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;&lt;label for=&quot;province&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Province&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;province&quot; id=&quot;province&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'province'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
&lt;span class=&quot;description&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter your province.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;&lt;label for=&quot;postalcode&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Postal Code&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input type=&quot;text&quot; name=&quot;postalcode&quot; id=&quot;postalcode&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'postalcode'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
&lt;span class=&quot;description&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Please enter your postal code.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'personal_options_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'save_extra_user_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user_profile_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'save_extra_user_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> save_extra_user_profile_fields<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
update_user_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'address'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
update_user_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'city'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'city'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
update_user_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'province'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'province'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
update_user_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'postalcode'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'postalcode'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/adding-extra-fields-to-the-wordpress-user-profile/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Add Time to the Date Function in PHP</title>
		<link>http://bavotasan.com/2009/add-time-to-the-date-function-in-php/</link>
		<comments>http://bavotasan.com/2009/add-time-to-the-date-function-in-php/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 21:36:07 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[expiration]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[month]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Php Function]]></category>
		<category><![CDATA[Programmers]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[today]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=541</guid>
		<description><![CDATA[I just needed to do this for a client&#8217;s site to set an expiration date for a user and I thought it might be something that other programmers might like to know how to do. If you need to take today&#8217;s date and add time to it it is pretty simple. There is a PHP [...]]]></description>
			<content:encoded><![CDATA[<p>I just needed to do this for a client&#8217;s site to set an expiration date for a user and I thought it might be something that other programmers might like to know how to do. If you need to take today&#8217;s date and add time to it it is pretty simple. There is a PHP function called date() and another called strtotime(). You need to use both to make this happen.<br />
<span id="more-541"></span></p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$timestamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; + 1 month&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$expired</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>If you echoed out $date you would get today&#8217;s date formatted like &#8220;2009-04-21&#8243;.</p>
<p>If you echoed out $expired you would get today&#8217;s date plus 1 month, formatted like &#8220;2009-05-21&#8243;.</p>
<p>You can replace the &#8220;1 month&#8221; with &#8220;14 days&#8221; or &#8220;2 years&#8221; or whichever increment you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/add-time-to-the-date-function-in-php/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Show Your Search Query in WordPress</title>
		<link>http://bavotasan.com/2009/show-your-search-query-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/show-your-search-query-in-wordpress/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 20:10:07 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[Query Function]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Search Query]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=396</guid>
		<description><![CDATA[Wouldn&#8217;t you like to be able to display the actual search term entered by your user on the search results&#8217; page? Good thing there is a very simple way in WordPress to do that with the_search_query function. Just open up your search.php file and enter: &#60;?php the_search_query&#40;&#41;; ?&#62; to display the search term that was [...]]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t you like to be able to display the actual search term entered by your user on the search results&#8217; page? Good thing there is a very simple way in WordPress to do that with the_search_query function.<span id="more-396"></span> Just open up your search.php file and enter:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_search_query<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></td></tr></table></div>

<p>to display the search term that was entered. So something like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Search Results for &quot;'</span><span style="color: #339933;">;</span> the_search_query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>would display something that looked like this:</p>
<p><strong>Search Results for &#8220;the search term&#8221;</strong></p>
<p>Another cool little trick it to add the number of search results. Use this code:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$mySearch</span> <span style="color: #339933;">=&amp;</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;s=<span style="color: #006699; font-weight: bold;">$s</span> &amp; showposts=-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mySearch</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_count</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' search results for &quot;'</span><span style="color: #339933;">;</span> the_search_query<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></td></tr></table></div>

<p>to display something like:</p>
<p><strong>18 search results for &#8220;the search term&#8221;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/show-your-search-query-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Checking if a Widget has Been Activated in WordPress</title>
		<link>http://bavotasan.com/2009/checking-if-a-widget-has-been-activated-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/checking-if-a-widget-has-been-activated-in-wordpress/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 19:05:23 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Functionality]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[premium]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[Upload]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Widget Name]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=224</guid>
		<description><![CDATA[Sometimes, it is extremely difficult to find out if a function already exists in WordPress or if you need to create one yourself to get it to function how you need it to. I had created a widget for my Magazine Basic 2.0 free premium theme and I needed to make sure that if it [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, it is extremely difficult to find out if a function already exists in WordPress or if you need to create one yourself to get it to function how you need it to. I had created a widget for my <a href="http://bavotasan.com/wordpress/free-wordpress-themes/magazine-basic-free-wordpress-theme/">Magazine Basic 2.0 free premium theme </a> and I needed to make sure that if it was added to a user&#8217;s sidebar, then certain functionality would occur.<br />
<span id="more-224"></span><br />
I couldn&#8217;t find out how to do it so I decided to use PHP Sessions. The only problem with this is that WordPress doesn&#8217;t allow you to upload a theme to <a href="http://wordpress.org ">WordPress.org </a>that uses Sessions. So I searched and searched and finally found what I need buried deep in the WordPress code. To check if a widget has been activated you need to use the following code.</p>
<p><code>is_active_widget('name_of_widget')</code></p>
<p>Replace name_of_widget with the original function name of your widget. If you were using my <a href="http://bavotasan.com/tutorials/how-to-create-a-wordpress-widget/">Features Post</a> widget then the code to check if it is activated would be:</p>
<p><code>is_active_widget('widget_myFeature')</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/checking-if-a-widget-has-been-activated-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Issue with the User Logout Button in WordPress 2.7</title>
		<link>http://bavotasan.com/2009/issue-with-the-user-logout-button-in-wordpress-27/</link>
		<comments>http://bavotasan.com/2009/issue-with-the-user-logout-button-in-wordpress-27/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 18:19:53 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=181</guid>
		<description><![CDATA[I noticed a small issue in WordPress 2.7 when I was designing a login bar at the top of a client&#8217;s site and the logout link would not log the user out. I had coded the same way I had coded a logout button in the past, but it wouldn&#8217;t function properly. That is because [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed a small issue in WordPress 2.7 when I was designing a login bar at the top of a client&#8217;s site and the logout link would not log the user out. I had coded the same way I had coded a logout button in the past, but it wouldn&#8217;t function properly. That is because WordPress 2.7 uses a new function to log a user out.<br />
<span id="more-181"></span><br />
Here is the code I use to use:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-login.php?action=logout&quot;&gt;Logout&lt;/a&gt;</pre></div></td></tr></table></div>

<p>And here is the new code I now use:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Logout&lt;/a&gt;</pre></div></td></tr></table></div>

<p>And here is a little bit of spice to make it redirect back to the current page:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; &gt;Logout&lt;/a&gt;</pre></div></td></tr></table></div>

<p>Nore:  If you are using an theme that was designed before 2.7, you should go into your comments.php file and change the anchor tag around line 78 to fix your Logout link.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/issue-with-the-user-logout-button-in-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

