<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Adding and using custom user profile fields</title>
	<atom:link href="http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Wed, 17 Mar 2010 18:36:20 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mitch Canter</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-181704</link>
		<dc:creator>Mitch Canter</dc:creator>
		<pubDate>Wed, 17 Mar 2010 02:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-181704</guid>
		<description>I know this is an old post, but it&#039;s still a fantastic resource.

What most people don&#039;t know is that you can call these fields not only in a function, but also in an author template.

For example, instead of using the_author_meta, you use 
twitter; ?&gt;

Allows for some SWEET Mashable style profile pages with bio, social networks, etc on top, and recent posts by author on the bottom.</description>
		<content:encoded><![CDATA[<p>I know this is an old post, but it&#8217;s still a fantastic resource.</p>
<p>What most people don&#8217;t know is that you can call these fields not only in a function, but also in an author template.</p>
<p>For example, instead of using the_author_meta, you use<br />
twitter; ?&gt;</p>
<p>Allows for some SWEET Mashable style profile pages with bio, social networks, etc on top, and recent posts by author on the bottom.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Cannon</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-181667</link>
		<dc:creator>Dan Cannon</dc:creator>
		<pubDate>Tue, 16 Mar 2010 20:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-181667</guid>
		<description>Just a note the `user_register` hook works for processing custom fields added using the `register_form` hook. 

You get access to both the new user id as well as the $_POST variables using that hook which is all you need to use `update_usermeta`

Just had to do this earlier today on a project I&#039;m working on (using WP 2.9.2)</description>
		<content:encoded><![CDATA[<p>Just a note the `user_register` hook works for processing custom fields added using the `register_form` hook. </p>
<p>You get access to both the new user id as well as the $_POST variables using that hook which is all you need to use `update_usermeta`</p>
<p>Just had to do this earlier today on a project I&#8217;m working on (using WP 2.9.2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duane</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-181450</link>
		<dc:creator>Duane</dc:creator>
		<pubDate>Mon, 15 Mar 2010 05:19:20 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-181450</guid>
		<description>Really great post! Very helpful, I am working on a project where I am using wordpress as a company intranet CMS and this has come very handy. I was sent here from: http://www.dquinn.net/extending-user-profiles-wordpress/ where I had some other great ideas that I integrated into the mix. 

My question for you is can this method be used to create a date of birth field? I want to be able to send birthday cards to each member based on a dob field in the user profile. I am not sure how I would implement this so anything you can contribute would be great.

Again thanks for the great insight.</description>
		<content:encoded><![CDATA[<p>Really great post! Very helpful, I am working on a project where I am using wordpress as a company intranet CMS and this has come very handy. I was sent here from: <a href="http://www.dquinn.net/extending-user-profiles-wordpress/" rel="nofollow">http://www.dquinn.net/extending-user-profiles-wordpress/</a> where I had some other great ideas that I integrated into the mix. </p>
<p>My question for you is can this method be used to create a date of birth field? I want to be able to send birthday cards to each member based on a dob field in the user profile. I am not sure how I would implement this so anything you can contribute would be great.</p>
<p>Again thanks for the great insight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-180050</link>
		<dc:creator>Jerry</dc:creator>
		<pubDate>Thu, 04 Mar 2010 01:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-180050</guid>
		<description>Justin,

I&#039;ve added the code above to write to the usermeta SQL table and got it to work in Thesis.  But, I&#039;d like to save the new field to the &quot;users&quot; database table instead of the usermeta table. I need to query the users database because I&#039;m attempting to omit authors that have a new_field set to &quot;guest&quot; and would like to use the code below for this.     

&lt;pre&gt;&lt;code&gt;$authors = $wpdb-&gt;get_results(&quot;SELECT ID, user_nicename from $wpdb-&gt;users WHERE new_field  &#039;guest&#039; ORDER BY display_name&quot;); &lt;/code&gt;&lt;/pre&gt;

Any idea how would modify your code above to save to the users databse table instead of the usermeta?  To me, the two tables look so different that I decided against just substituting &quot;users&quot; for &quot;usermeta&quot; above. I&#039;m pretty new to coding in WP and appreciate any guidance.</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>I&#8217;ve added the code above to write to the usermeta SQL table and got it to work in Thesis.  But, I&#8217;d like to save the new field to the &#8220;users&#8221; database table instead of the usermeta table. I need to query the users database because I&#8217;m attempting to omit authors that have a new_field set to &#8220;guest&#8221; and would like to use the code below for this.     </p>
<pre><code>$authors = $wpdb-&gt;get_results("SELECT ID, user_nicename from $wpdb-&gt;users WHERE new_field  'guest' ORDER BY display_name"); </code></pre>
<p>Any idea how would modify your code above to save to the users databse table instead of the usermeta?  To me, the two tables look so different that I decided against just substituting &#8220;users&#8221; for &#8220;usermeta&#8221; above. I&#8217;m pretty new to coding in WP and appreciate any guidance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MoeAlza</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-179487</link>
		<dc:creator>MoeAlza</dc:creator>
		<pubDate>Sat, 27 Feb 2010 23:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-179487</guid>
		<description>So for the first bit of code, where exactly do you place it in the functions.php file?</description>
		<content:encoded><![CDATA[<p>So for the first bit of code, where exactly do you place it in the functions.php file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Frosty</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-178821</link>
		<dc:creator>The Frosty</dc:creator>
		<pubDate>Tue, 23 Feb 2010 19:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-178821</guid>
		<description>I figured it out:

&lt;pre&gt;&lt;code&gt;&lt;input type=&quot;radio&quot; name=&quot;account&quot; value=&quot;Developer&quot; id=&quot;developer&quot; &lt;?php if ( $account == &#039;Developer&#039; ) echo &#039;checked=&quot;checked&quot;&#039;; ?&gt; /&gt;Developer
  &lt;input type=&quot;radio&quot; name=&quot;account&quot; value=&quot;Sponsor&quot; id=&quot;sponsor&quot; &lt;?php if ( $account == &#039;Sponsor&#039; ) echo &#039;checked=&quot;checked&quot;&#039;; ?&gt; /&gt;Sponsor

update_usermeta( $user_id, &#039;account&#039;, $_POST[&#039;account&#039;] );&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I figured it out:</p>
<pre><code>&lt;input type=&quot;radio&quot; name=&quot;account&quot; value=&quot;Developer&quot; id=&quot;developer&quot; &lt;?php if ( $account == 'Developer' ) echo 'checked=&quot;checked&quot;'; ?&gt; /&gt;Developer
  &lt;input type=&quot;radio&quot; name=&quot;account&quot; value=&quot;Sponsor&quot; id=&quot;sponsor&quot; &lt;?php if ( $account == 'Sponsor' ) echo 'checked=&quot;checked&quot;'; ?&gt; /&gt;Sponsor

update_usermeta( $user_id, 'account', $_POST['account'] );</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Frosty</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-178817</link>
		<dc:creator>The Frosty</dc:creator>
		<pubDate>Tue, 23 Feb 2010 18:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-178817</guid>
		<description>What about radio fields?

Would this be correct:
&lt;pre&gt;&lt;code&gt;&lt;input type=&quot;radio&quot; name=&quot;account[]&quot; value=&quot;developer&quot; ID ) ) echo &#039;checked=&quot;checked&quot;&#039;; ?&gt; /&gt;Developer

            	&lt;input type=&quot;radio&quot; name=&quot;account[]&quot; value=&quot;sponsor&quot; ID ) ) echo &#039;checked=&quot;checked&quot;&#039;; ?&gt; /&gt;Sponsor&lt;/code&gt;&lt;/pre&gt;

And would I have to add just one POST, or multiple?

One:

&lt;pre&gt;&lt;code&gt;update_usermeta( $user_id, &#039;account&#039;, $_POST[&#039;account&#039;] );&lt;/code&gt;&lt;/pre&gt;

Or Two:

&lt;pre&gt;&lt;code&gt;update_usermeta( $user_id, &#039;account[developer]&#039;, $_POST[&#039;account&#039;] );
update_usermeta( $user_id, &#039;account[sponsor]&#039;, $_POST[&#039;account&#039;] );&lt;/code&gt;&lt;/pre&gt;

If I am on the right path.. ;)</description>
		<content:encoded><![CDATA[<p>What about radio fields?</p>
<p>Would this be correct:</p>
<pre><code>&lt;input type=&quot;radio&quot; name=&quot;account[]&quot; value=&quot;developer&quot; ID ) ) echo 'checked="checked"'; ?&gt; /&gt;Developer

            	&lt;input type=&quot;radio&quot; name=&quot;account[]&quot; value=&quot;sponsor&quot; ID ) ) echo 'checked="checked"'; ?&gt; /&gt;Sponsor</code></pre>
<p>And would I have to add just one POST, or multiple?</p>
<p>One:</p>
<pre><code>update_usermeta( $user_id, 'account', $_POST['account'] );</code></pre>
<p>Or Two:</p>
<pre><code>update_usermeta( $user_id, 'account[developer]', $_POST['account'] );
update_usermeta( $user_id, 'account[sponsor]', $_POST['account'] );</code></pre>
<p>If I am on the right path.. <img src='http://justintadlock.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FlossieT</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-178800</link>
		<dc:creator>FlossieT</dc:creator>
		<pubDate>Tue, 23 Feb 2010 15:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-178800</guid>
		<description>This is fantastic and just what I&#039;ve been looking for - we run a multi-author blog, and want to include a list of selected contributors in the sidebar; I&#039;m thinking we can set a custom field for &#039;include in sidebar&#039;, and then code a widget to pull through just those contributors that have that flag set.</description>
		<content:encoded><![CDATA[<p>This is fantastic and just what I&#8217;ve been looking for &#8211; we run a multi-author blog, and want to include a list of selected contributors in the sidebar; I&#8217;m thinking we can set a custom field for &#8216;include in sidebar&#8217;, and then code a widget to pull through just those contributors that have that flag set.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendan</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-177642</link>
		<dc:creator>Brendan</dc:creator>
		<pubDate>Thu, 11 Feb 2010 15:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-177642</guid>
		<description>One more time, trying the code tag...I&#039;m not spamming, I promise!

Thanks so much for posting this! I’m creating a corporate intranet and this paired with the (modified) WordPress Users plug-in will basically create a mini social network! Good stuff.

Some people had asked how to do this with other forms of input, and, praise God for it, I figured out how to do it with the select menu! Here’s the code (I don’t know if there’s a way to format it as code?):

&lt;pre&gt;&lt;code&gt;add_action( &#039;show_user_profile&#039;, &#039;my_show_extra_profile_fields&#039; );
add_action( &#039;edit_user_profile&#039;, &#039;my_show_extra_profile_fields&#039; );

function my_show_extra_profile_fields( $user ) { ?&gt;

	Extra profile information

	Favorite Color
ID ) );

foreach ($fav_color as $fav_id =&gt; $fav) { ?&gt;
  &lt;option  id=&quot;&quot; value=&quot;&quot;&gt;

  Please select your favorite color from this menu.&lt;/code&gt;&lt;/pre&gt;

Hope this helps someone!</description>
		<content:encoded><![CDATA[<p>One more time, trying the code tag&#8230;I&#8217;m not spamming, I promise!</p>
<p>Thanks so much for posting this! I’m creating a corporate intranet and this paired with the (modified) WordPress Users plug-in will basically create a mini social network! Good stuff.</p>
<p>Some people had asked how to do this with other forms of input, and, praise God for it, I figured out how to do it with the select menu! Here’s the code (I don’t know if there’s a way to format it as code?):</p>
<pre><code>add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );

function my_show_extra_profile_fields( $user ) { ?&gt;

	Extra profile information

	Favorite Color
ID ) );

foreach ($fav_color as $fav_id =&gt; $fav) { ?&gt;
  &lt;option  id="" value=""&gt;

  Please select your favorite color from this menu.</code></pre>
<p>Hope this helps someone!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hr</title>
		<link>http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields#comment-177627</link>
		<dc:creator>hr</dc:creator>
		<pubDate>Thu, 11 Feb 2010 10:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1796#comment-177627</guid>
		<description>i use that code but when trying to edit user profiles  user.php have error promt</description>
		<content:encoded><![CDATA[<p>i use that code but when trying to edit user profiles  user.php have error promt</p>
]]></content:encoded>
	</item>
</channel>
</rss>
