CINXE.COM
Adding Extra Fields to the WordPress User Profile | bavotasan.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" dir="ltr" lang="en-US"> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/","20101120004455","https://web.archive.org/","web","/_static/", "1290213895"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="googlebot" content="index,archive,follow,noodp"/> <meta name="robots" content="all,index,follow"/> <meta name="msnbot" content="all,index,follow"/> <meta name="description" content="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..."/> <meta name="keywords" content="bit,code,default,info,information,Profile,site,theme,user,WordPress,"/> <title>Adding Extra Fields to the WordPress User Profile | bavotasan.com</title> <link rel="stylesheet" href="https://web.archive.org/web/20101120004455cs_/http://bavotasan.com/wp-content/themes/bavotasan-2010/style.css?ver=1.0.8" type="text/css" media="screen"/> <link rel="shortcut icon" href="https://web.archive.org/web/20101120004455im_/http://bavotasan.com/favicon.ico"/> <link rel="pingback" href="http://bavotasan.com/xmlrpc.php"/> <link rel="alternate" type="application/rss+xml" title="bavotasan.com » Feed" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/feed/"/> <link rel="alternate" type="application/rss+xml" title="bavotasan.com » Comments Feed" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/comments/feed/"/> <link rel="alternate" type="application/rss+xml" title="bavotasan.com » Adding Extra Fields to the WordPress User Profile Comments Feed" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/feed/"/> <script type="text/javascript" src="https://web.archive.org/web/20101120004455js_/http://bavotasan.com/wp-includes/js/jquery/jquery.js?ver=1.4.2"></script> <link rel="index" title="bavotasan.com" href="http://bavotasan.com/"/> <link rel="start" title="Removing Images from a WordPress Post: Redux" href="http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/"/> <link rel="prev" title="Using PHP to Remove an HTML Tag from a String" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/using-php-to-remove-an-html-tag-from-a-string/"/> <link rel="next" title="Simple Voting for WordPress with PHP and jQuery" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/simple-voting-for-wordpress-with-php-and-jquery/"/> <link rel="canonical" href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/"/> <link rel="shortlink" href="https://web.archive.org/web/20101120004455/http://bit.ly/ckXZzT"/> <script type="text/javascript" src="https://web.archive.org/web/20101120004455js_/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script> <meta property="fb:page_id" content="137456822940271"/> <meta property="fb:admins" content="586505548"/> <meta property="og:site_name" content="bavotasan.com"/> <meta property="og:title" content="Adding Extra Fields to the WordPress User Profile"/> <meta property="og:description" content="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 [...]"/> <meta property="og:type" content="article"/> <meta property="og:image" content="https://web.archive.org/web/20101120004455im_/http://bavotasan.com/wp-content/uploads/2009/12/edituser.jpg"/> </head> <body class="single single-post postid-1578"> <div id="bodywrap"> <!-- BuySellAds.com Ad Code --> <script type="text/javascript"> (function(){ var bsa = document.createElement('script'); bsa.type = 'text/javascript'; bsa.async = true; bsa.src = '//web.archive.org/web/20101120004455/http://s3.buysellads.com/ac/bsa.js'; (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa); })(); </script> <!-- END BuySellAds.com Ad Code --> <!-- begin header --> <div id="header"> <div id="topmenu" class="menu-top-menu-container"><ul id="menu-top-menu" class="menu"><li id="menu-item-2254" class="menu-item menu-item-type-custom menu-item-2254"><a href="https://web.archive.org/web/20101120004455/http://themes.bavotasan.com/">Themes by bavotasan.com</a></li> <li id="menu-item-2255" class="menu-item menu-item-type-custom menu-item-2255"><a href="https://web.archive.org/web/20101120004455/http://themes.bavotasan.com/support/">Support Forum</a></li> <li id="menu-item-2259" class="menu-item menu-item-type-custom menu-item-2259"><a href="https://web.archive.org/web/20101120004455/http://themes.bavotasan.com/affiliates">Affiliates</a></li> <li id="menu-item-2256" class="menu-item menu-item-type-post_type menu-item-2256"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/about/">About</a></li> <li id="menu-item-2257" class="menu-item menu-item-type-post_type menu-item-2257"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/services/">Services</a></li> <li id="menu-item-2258" class="menu-item menu-item-type-post_type menu-item-2258"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/contact/">Contact</a></li> </ul></div> <div id="title"> <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/"> <img src="https://web.archive.org/web/20101120004455im_/http://bavotasan.com/wp-content/themes/bavotasan-2010/images/bavotasan.png" alt="bavotasan.com" width="400" height="70"/> <span id="desc"></span></a> </div> <div id="follow"> <span></span> <a href="https://web.archive.org/web/20101120004455/http://twitter.com/bavotasan" class="twitter"></a> <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/feed/" class="rss"></a> </div> <div id="navigation" class="menu-main-menu-container"> <ul id="menu-main-menu" class="menu"> <li id="menu-item-2264"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/"><span></span>Home</a></li> <li id="menu-item-2266"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/category/articles/"><span></span>Articles</a></li> <li id="menu-item-2265" class="current-menu-item"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/category/tutorials/"><span></span>Tutorials</a></li> <li id="menu-item-2267"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/category/downloads/"><span></span>Downloads</a></li> </ul> </div> </div> <!-- end header --> <div id="mainwrapper"> <div id="leftcontent"> <div class="posttop"> <div class="thedate"><div class="month">Dec</div><div class="day">10</div><div class="year">2009</div></div> <h1>Adding Extra Fields to the WordPress User Profile</h1> <br class="clear"/> <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’s <code>functions.php</code> file, or create a <code>functions.php</code> file if you don’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;"><?php</span> add_action<span style="color: #009900;">(</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;">)</span><span style="color: #339933;">;</span> add_action<span style="color: #009900;">(</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;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">function</span> extra_user_profile_fields<span style="color: #009900;">(</span> <span style="color: #000088;">$user</span> <span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #000000; font-weight: bold;">?></span> <h3><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Extra profile information"</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">"blank"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></h3> <table class="form-table"> <tr> <th><label for="address"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Address"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></label></th> <td> <input type="text" name="address" id="address" value="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">(</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'address'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-></span><span style="color: #004000;">ID</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span>" class="regular-text" /><br /> <span class="description"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Please enter your address."</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></span> </td> </tr> <tr> <th><label for="city"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"City"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></label></th> <td> <input type="text" name="city" id="city" value="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">(</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'city'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-></span><span style="color: #004000;">ID</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span>" class="regular-text" /><br /> <span class="description"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Please enter your city."</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></span> </td> </tr> <tr> <th><label for="province"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Province"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></label></th> <td> <input type="text" name="province" id="province" value="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">(</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'province'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-></span><span style="color: #004000;">ID</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span>" class="regular-text" /><br /> <span class="description"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Please enter your province."</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></span> </td> </tr> <tr> <th><label for="postalcode"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Postal Code"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></label></th> <td> <input type="text" name="postalcode" id="postalcode" value="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">(</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'postalcode'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-></span><span style="color: #004000;">ID</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span>" class="regular-text" /><br /> <span class="description"><span style="color: #000000; font-weight: bold;"><?php</span> _e<span style="color: #009900;">(</span><span style="color: #0000ff;">"Please enter your postal code."</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></span> </td> </tr> </table> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #009900;">}</span> add_action<span style="color: #009900;">(</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;">)</span><span style="color: #339933;">;</span> add_action<span style="color: #009900;">(</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;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">function</span> save_extra_user_profile_fields<span style="color: #009900;">(</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">(</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">(</span> <span style="color: #0000ff;">'edit_user'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span> <span style="color: #009900;">{</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;">}</span> update_usermeta<span style="color: #009900;">(</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;">[</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">]</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> update_usermeta<span style="color: #009900;">(</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;">[</span><span style="color: #0000ff;">'city'</span><span style="color: #009900;">]</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> update_usermeta<span style="color: #009900;">(</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;">[</span><span style="color: #0000ff;">'province'</span><span style="color: #009900;">]</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> update_usermeta<span style="color: #009900;">(</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;">[</span><span style="color: #0000ff;">'postalcode'</span><span style="color: #009900;">]</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> <span style="color: #000000; font-weight: bold;">?></span></pre></div></td></tr></table></div> <div class="buttonbox"> </div> </div> <div class="post"> <div class="socialleft">If you liked this, please share it.</div> <ul class="addtoany_list"> <li><a href="https://web.archive.org/web/20101120004455/http://twitter.com/share?url=http%3A%2F%2Fbit.ly%2FckXZzT&counturl=http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/" class="twitter-share-button" data-count="vertical" data-via="bavotasan">Tweet</a><script type="text/javascript" src="https://web.archive.org/web/20101120004455js_/http://platform.twitter.com/widgets.js"></script></li> <li><a href="https://web.archive.org/web/20101120004455/http://www.facebook.com/sharer.php?u=http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/&t=Adding Extra Fields to the WordPress User Profile" title="Click to send this page to Facebook!" target="_blank" rel="nofollow" class="facebook-icon"></a></li> <li><a href="https://web.archive.org/web/20101120004455/http://digg.com/submit?phase=2&url=http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/&title=Adding Extra Fields to the WordPress User Profile&bodytext=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 [...]" title="Digg" rel="nofollow" target="_blank" class="digg-icon"></a></li> <li><a href="https://web.archive.org/web/20101120004455/http://www.delicious.com/save" onclick="window.open('https://web.archive.org/web/20101120004455/http://www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent('https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/')+'&title='+encodeURIComponent('Adding Extra Fields to the WordPress User Profile'),'delicious', 'toolbar=no,width=550,height=550'); return false;" class="delicious-icon"></a></li> <li><a href="https://web.archive.org/web/20101120004455/http://www.stumbleupon.com/submit?url=http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/&title=Adding Extra Fields to the WordPress User Profile" title="StumbleUpon" rel="nofollow" target="_blank" class="stumbleupon-icon"></a></li> <li><iframe src="https://web.archive.org/web/20101120004455if_/http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fbavotasan.com%2Ftutorials%2Fadding-extra-fields-to-the-wordpress-user-profile%2F&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowtransparency="true"></iframe></li> </ul> </div> <div class="post"> <p class="tags">Tags: <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/bit/" rel="tag">bit</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/code/" rel="tag">code</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/default/" rel="tag">default</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/info/" rel="tag">info</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/information/" rel="tag">information</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/profile/" rel="tag">Profile</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/site/" rel="tag">site</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/theme/" rel="tag">theme</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/user/" rel="tag">user</a>, <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tag/wordpress/" rel="tag">WordPress</a></p> <p class="tags">Short URL: <a href="https://web.archive.org/web/20101120004455/http://bit.ly/ckXZzT" title="Adding Extra Fields to the WordPress User Profile">http://bit.ly/ckXZzT</a></p> </div> <div class="post"> <div id="crp_related"> <h3>Similar Posts</h3> <ul> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/articles/magazine-premium-is-out/" rel="bookmark" title="Permanent Link to Magazine Premium v1.1.5 is Out!">Magazine Premium v1.1.5 is Out!</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/articles/a-new-look-for-themes-by-bavotasan-com/" rel="bookmark" title="Permanent Link to A New Look for Themes by bavotasan.com">A New Look for Themes by bavotasan.com</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/meta-descriptions-wordpress/" rel="bookmark" title="Permanent Link to Meta Descriptions for WordPress">Meta Descriptions for WordPress</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-tweet-button-wordpress/" rel="bookmark" title="Permanent Link to Adding a Tweet Button to WordPress">Adding a Tweet Button to WordPress</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/developing-themes-for-wordpress-options/" rel="bookmark" title="Permanent Link to Developing Themes for WordPress: Part 4">Developing Themes for WordPress: Part 4</a></li> </ul> </div> <a href="https://web.archive.org/web/20101120004455/http://www.netfirms.com/web-hosting/web-hosting-business/?a_aid=4c8bb52b19602&a_bid=8f049e07" target="_top" style="float:right;"><img src="https://web.archive.org/web/20101120004455im_/http://www.webhostrevenue.com/accounts/default1/banners/300x250-us.gif" alt="Netfirms Business Hosting Plan" title="Netfirms Business Hosting Plan" width="250" height="208"/></a><img style="border:0" src="https://web.archive.org/web/20101120004455im_/http://www.webhostrevenue.com/scripts/imp.php?a_aid=4c8bb52b19602&a_bid=8f049e07" width="1" height="1" alt=""/> </div> <div class="post"> <a href="#comment_list"></a> <div id="comments"> <h3 id="comments-title">Discussion <small> 40 Comments</small> </h3> <div class="navigation"> <div class="fl"></div> <div class="fr"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/comment-page-2/#comments">Newer Comments →</a></div> </div> <ol class="commentlist"> <li class="comment even thread-even depth-1" id="li-comment-7081"> <div id="comment-7081"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/e88a1fc080de7ad25f5c8fed0302fa66?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Jan</span> <span class="commentdate"> on January 12, 2010 at 2:52 pm</span> </div> <div class="comment-text"> <p>Hi,<br/> This looks very nice, but I have two additional newbie questions:<br/> 1. How, in a private blog, where the members cannot register but are registered by the admin, can they nevertheless update their profile with the additional fields?<br/> 2. Once the extra user fields are in the database, how to display (selected) fields in a table form on a page?<br/> Best regards,<br/> Jan</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=7081#respond" onclick="return addComment.moveForm("comment-7081", "7081", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-7409"> <div id="comment-7409"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on January 30, 2010 at 3:59 pm</span> </div> <div class="comment-text"> <p>1. Once a member is registered then can access their profile in the admin.</p> <p>2. Use the get_the_author_meta() function.</p> </div> </div> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-7397"> <div id="comment-7397"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d5b188a72792c4fc201ab13a5337005f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">kayjay</span> <span class="commentdate"> on January 30, 2010 at 5:04 am</span> </div> <div class="comment-text"> <p>Thanks for the great info!</p> <p>Couple of questions…<br/> 1. How to implement radio buttons?<br/> 2. How to add the custom fields to the registration page?</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=7397#respond" onclick="return addComment.moveForm("comment-7397", "7397", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-7408"> <div id="comment-7408"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on January 30, 2010 at 3:56 pm</span> </div> <div class="comment-text"> <p>To implement a radio button you just need to use a radio input like so:</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: #339933;"><</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">"radio"</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">"radio_button_name"</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">"yes"</span> <span style="color: #339933;">/><</span>label<span style="color: #339933;">></span>Yes<span style="color: #339933;"></</span>label<span style="color: #339933;">></span> <span style="color: #339933;"><</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">"radio"</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">"radio_button_name"</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">"no"</span> <span style="color: #339933;">/><</span>label<span style="color: #339933;">></span>No<span style="color: #339933;"></</span>label<span style="color: #339933;">></span></pre></div></td></tr></table></div> <p>Then you just need to add a new update_meta call like so:</p> <div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;">update_usermeta<span style="color: #009900;">(</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'radio_button_name'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">[</span><span style="color: #0000ff;">'radio_button_name'</span><span style="color: #009900;">]</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div> <p>Adding to the registration page is a bit more complicated but luckily there are some plugins available for that. Check out the directory.</p> </div> </div> </li> <li class="comment even depth-2" id="li-comment-7441"> <div id="comment-7441"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d5b188a72792c4fc201ab13a5337005f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">kayjay</span> <span class="commentdate"> on January 31, 2010 at 3:01 pm</span> </div> <div class="comment-text"> <p>Thanks for the quick response!</p> <p>My radio button problem was I was not displaying the checked value, so each time the user profile was re-saved the field was deleted. The following code solved the issue:</p> <div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;">ID <span style="color: #009900;">)</span><span style="color: #339933;">;</span> ?<span style="color: #339933;">&</span>gt<span style="color: #339933;">;</span> <span style="color: #339933;">&</span>lt<span style="color: #339933;">;</span>input type<span style="color: #339933;">=&</span>quot<span style="color: #339933;">;</span>radio<span style="color: #339933;">&</span>quot<span style="color: #339933;">;</span> name<span style="color: #339933;">=&</span>quot<span style="color: #339933;">;</span>field_name<span style="color: #339933;">&</span>quot<span style="color: #339933;">;</span> id<span style="color: #339933;">=&</span>quot<span style="color: #339933;">;</span>field_name<span style="color: #339933;">&</span>quot<span style="color: #339933;">;</span> value<span style="color: #339933;">=&</span>quot<span style="color: #339933;">;</span>yes<span style="color: #339933;">&</span>quot<span style="color: #339933;">;</span> <span style="color: #339933;">/&</span>gt<span style="color: #339933;">;</span>Yes</pre></div></td></tr></table></div> <p>Used Register Plus to implement a custom registration page.</p> <p>Thanks again for your help!</p> </div> </div> </li> <li class="comment odd alt depth-2" id="li-comment-7442"> <div id="comment-7442"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d5b188a72792c4fc201ab13a5337005f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">kayjay</span> <span class="commentdate"> on January 31, 2010 at 3:07 pm</span> </div> <div class="comment-text"> <p>Code did not paste well trying again:</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;">$field_name_selected</span> <span style="color: #339933;">=</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'field_name'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&</span>gt<span style="color: #339933;">;</span>ID <span style="color: #009900;">)</span><span style="color: #339933;">;</span> Yes</pre></div></td></tr></table></div> <p>Opening and closing php = respectively</p> </div> </div> </li> </ul> </li> <li class="comment even thread-even depth-1" id="li-comment-7443"> <div id="comment-7443"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d5b188a72792c4fc201ab13a5337005f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">kayjay</span> <span class="commentdate"> on January 31, 2010 at 3:11 pm</span> </div> <div class="comment-text"> <p>Sorry for all the responses. Still did not get it to paste correctly. Let me know if you’d like the code for users who may run into this issue in the future and maybe I could send it via email.</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=7443#respond" onclick="return addComment.moveForm("comment-7443", "7443", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-7817"> <div id="comment-7817"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/2a062a10cb94152f4ab3daf569af54c3?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://clioweb.org/" rel="external " class="url">Jeremy Boggs</a></span> <span class="commentdate"> on February 21, 2010 at 1:57 pm</span> </div> <div class="comment-text"> <p>Thanks for writing this. I’ve had a few issues with the Register Plus plugin, but this seems way easier to implement and customize. I can’t, however, find any reference to the ‘edit_user_profile_update’ action in the WordPress codex. Do you know if its documented somewhere else, or explains somewhere in the WP code?</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=7817#respond" onclick="return addComment.moveForm("comment-7817", "7817", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-even depth-1" id="li-comment-7995"> <div id="comment-7995"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/7f34c567e4962867297fe4bfc13a022e?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Joe</span> <span class="commentdate"> on March 2, 2010 at 9:08 am</span> </div> <div class="comment-text"> <p>I have put the code into my functions.php file and it shows up fine in the profile. This issue is when I edit the profile and hit the update profile button, I get a blank page and (profile.php). If I refresh the page, the profile comes back up.</p> <p>The only different I see between the default action (with the code not in place) and the new action is an some HTML after the profile.php</p> <p>?updated=true&wp_http_referer</p> <p>Any insight into what is going wrong?</p> <p>Thanks!<br/> -joe</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=7995#respond" onclick="return addComment.moveForm("comment-7995", "7995", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-8004"> <div id="comment-8004"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on March 2, 2010 at 4:39 pm</span> </div> <div class="comment-text"> <p>What version of WordPress are you using?</p> </div> </div> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-8237"> <div id="comment-8237"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/61355e769f3d839ddfa113494fc898a4?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.marketinglistinfo.com/" rel="external " class="url">garrett</a></span> <span class="commentdate"> on March 13, 2010 at 3:52 am</span> </div> <div class="comment-text"> <p>great little script, works flawlessly in 2.9.2. Displayed perfect in the user profiles and was easily able to add additional fields to the script. In addition, works perfectly with the_author_meta() to display the info on the site.</p> <p>thank you very much, garrett</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8237#respond" onclick="return addComment.moveForm("comment-8237", "8237", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-8494"> <div id="comment-8494"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/a30367cbabc8c369042fd898520ee9ea?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bit.ly/driP5k" rel="external " class="url">Fabian Afable</a></span> <span class="commentdate"> on March 25, 2010 at 6:37 pm</span> </div> <div class="comment-text"> <p>Hello just thought i would tell you something.. This is twice now i’ve landed on your blog in the last 3 days searching for totally unrelated things. Spooky or what? If you liketo swap the links with us please let me know.</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8494#respond" onclick="return addComment.moveForm("comment-8494", "8494", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-8599"> <div id="comment-8599"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/78893375bce16c562683b963a24efbeb?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Faizan</span> <span class="commentdate"> on April 2, 2010 at 5:00 pm</span> </div> <div class="comment-text"> <p>Hello this is a great tutorial saved me a lot of time. I am just having one issue when put something in the custom textarea which i added to the profile and click update profile it does not get saved. If someone can help me with this problem i would appreciate it. Thank You.</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8599#respond" onclick="return addComment.moveForm("comment-8599", "8599", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-8762"> <div id="comment-8762"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d053c94807330abfe491ab99c2e484d0?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.mansanity.com/" rel="external " class="url">garrett</a></span> <span class="commentdate"> on April 13, 2010 at 11:46 pm</span> </div> <div class="comment-text"> <p>@ c.bavota</p> <p>hello again, script still working excellent, one question however, I am trying to allow only user level 8 and above to be able to update the user meta. I currently have it working by adding</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: #666666; font-style: italic;">//retrieve current user info</span> <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$current_user</span><span style="color: #339933;">;</span> get_currentuserinfo<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//set rule to only allow profile information to be edited by user level 8 or greater</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">(</span><span style="color: #000088;">$current_user</span><span style="color: #339933;">-&</span>gt<span style="color: #339933;">;</span>user_level <span style="color: #339933;">&</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">)</span></pre></div></td></tr></table></div> <p>The problem is I have to add it before each update_usermeta. It actually works exactly how I want this way but its kind of ugly, would you know of a cleaner method?</p> <p>thanks very much</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8762#respond" onclick="return addComment.moveForm("comment-8762", "8762", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor even depth-2" id="li-comment-8764"> <div id="comment-8764"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on April 14, 2010 at 9:27 am</span> </div> <div class="comment-text"> <p>I think for that, you might want to use a readonly parameter on the inputs so that users below level 8 can’t change the inputs.</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: #b1b100;">if</span> <span style="color: #009900;">(</span><span style="color: #000088;">$current_user</span><span style="color: #339933;">-></span><span style="color: #004000;">user_level</span> <span style="color: #339933;"><</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #000088;">$readonly</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">" readonly="</span>readonly<span style="color: #0000ff;">"; }</span></pre></div></td></tr></table></div> <p>Then add the $readonly variable into each input field like so:</p> <div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><input type="text" name="address" id="address" value="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">(</span> get_the_author_meta<span style="color: #009900;">(</span> <span style="color: #0000ff;">'address'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-></span><span style="color: #004000;">ID</span> <span style="color: #009900;">)</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span>" class="regular-text"<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$readonly</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span> /><br /></pre></div></td></tr></table></div> <p>Now, if a user is lower then level 8, the $readonly variable will have a value and those input fields will not allow change.</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-8773"> <div id="comment-8773"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/02c6eefac9a2ee6fe4064ad4c83a5821?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://viniciusalmeida.com.br/" rel="external " class="url">Vinicius Almeida</a></span> <span class="commentdate"> on April 14, 2010 at 4:04 pm</span> </div> <div class="comment-text"> <p>Very usefull post, thanks!</p> <p>How insert a new role for the users?<br/> Example: User roles: student, professor, coordinator.</p> <p>how?</p> <p>thanks!</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8773#respond" onclick="return addComment.moveForm("comment-8773", "8773", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-even depth-1" id="li-comment-8786"> <div id="comment-8786"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d053c94807330abfe491ab99c2e484d0?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.firm7marketingsvcs.com/" rel="external " class="url">garrett</a></span> <span class="commentdate"> on April 16, 2010 at 12:32 am</span> </div> <div class="comment-text"> <p>@c.bavota</p> <p>thanks very much for the prompt reply, that is quite refreshing in itself. i tried your suggestion to no avail. i have to admit i did not spend a lot of time on it but i did a little reading and i think “readonly” is strange in php, from what i can tell it would need its own class defined, of which i found a couple examples but have not had the time to try them out or attempt myself. From what i read however, “readonly” is somewhat of an anomaly in php. If you feel like messing with it that would be cool and i would love to see your resolution but certainly don’t pull your hair out over it since, as i said, my method works perfectly, just quite ugly!</p> <p>thanks very much again and i will check back!</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=8786#respond" onclick="return addComment.moveForm("comment-8786", "8786", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-9022"> <div id="comment-9022"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/a12147120ba3222e11b2ae702d8673b7?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.layabozi.com/" rel="external " class="url">mache</a></span> <span class="commentdate"> on April 27, 2010 at 11:21 pm</span> </div> <div class="comment-text"> <p>hi<br/> i’ve been trying for long to figure out the best way to do this. and i found a plugin but it’s pretty complicated to use for a non-pro, as me. so, first, thanks.<br/> and second, i’m still having a problem. i believe it can be with adding other function to functions.php, where i’m also defining the sidebars i’m using. so i’m getting this error, when trying to save the info on the new fields for a user. this is the error:<br/> Warning: Cannot modify header information – headers already sent by (output started at /home7/layabozi/public_html/test/wordpress/wp-content/themes/Layabozi Reload/functions.php:44) in /home7/layabozi/public_html/test/wordpress/wp-includes/pluggable.php on line 868</p> <p>I have no idea why it’s the pluggable.php reacting on this, and on functions line 44 is where your code begins. </p> <p>do u think you can help me? or should i try to figure out that plugin to solve my nightmares? :/</p> <p>anyway, thanks again</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=9022#respond" onclick="return addComment.moveForm("comment-9022", "9022", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-even depth-1" id="li-comment-12324"> <div id="comment-12324"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/26d406d8402d1a2e31c7c50d9e255d0a?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://usatalk2012.com/" rel="external " class="url">Rat</a></span> <span class="commentdate"> on July 6, 2010 at 6:50 am</span> </div> <div class="comment-text"> <p>I think you can help me. Your work is great I want to know how to add a form in the members profile section that post to the admins profile area. Or do you know of any plug in that can do this.</p> <p>Thanks</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=12324#respond" onclick="return addComment.moveForm("comment-12324", "12324", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-12325"> <div id="comment-12325"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on July 6, 2010 at 9:14 am</span> </div> <div class="comment-text"> <p>What exactly do you want to add?</p> </div> </div> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-12361"> <div id="comment-12361"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/26d406d8402d1a2e31c7c50d9e255d0a?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://usatalk2012.com/" rel="external " class="url">Rat</a></span> <span class="commentdate"> on July 7, 2010 at 3:34 am</span> </div> <div class="comment-text"> <p>I would like to add extra fields to the members profile section that will post the information to the dashboard for the admin.<br/> Fields are as listed -<br/> First name:<br/> Last name:<br/> Address: City: State: Zip:<br/> Email:<br/> Email Conformation:<br/> Check-in date:<br/> Checkout Date:<br/> Event name:<br/> Rate Paid:<br/> Reservation made By:</p> <p>I want it to post in the dashboard area for the admin. In members order. Most important is the email address. The purpose is to send out news letters and coupons to these email addresses. All my subscribers will be business owners only. Some sort of search would be a good idea to sort threw this info.<br/> Thank You</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=12361#respond" onclick="return addComment.moveForm("comment-12361", "12361", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-12386"> <div id="comment-12386"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on July 7, 2010 at 12:05 pm</span> </div> <div class="comment-text"> <p>You should probably use a mailing list plugin like MailPress to maintain your subscribers. </p> <p>As for the extra fields on the profile page, I suggest adding them like in the code above.</p> </div> </div> </li> </ul> </li> <li class="comment even thread-even depth-1" id="li-comment-14360"> <div id="comment-14360"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/b7edb51a10a9533fa440ac7e273fc632?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">a.poloczek</span> <span class="commentdate"> on July 22, 2010 at 8:46 am</span> </div> <div class="comment-text"> <p>great article and some great answers here.<br/> maybe here is someone who can help me… i am looking for a solution or tip to store a timestamp (user profile last modified at:) in the user_meta table every time a user updates his profile. in theory i thought a hidden field with a date function could solve my problem, but i really stuck at this point.</p> <p>the best solution would be that all user profile informations will send per mail to the admin, if the user submit the profiles changes. If anybody has tips to solve that or has a working solution… please let me know. i would also pay for that… thanks</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=14360#respond" onclick="return addComment.moveForm("comment-14360", "14360", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-14362"> <div id="comment-14362"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on July 22, 2010 at 9:17 am</span> </div> <div class="comment-text"> <p>You can hook into an action when the user profile is saved and either add a field for the date or email the admin. If you are interested in having me build a plugin for you let me know by emailing me through the contact link above.</p> </div> </div> </li> <li class="comment even depth-2" id="li-comment-14403"> <div id="comment-14403"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/b7edb51a10a9533fa440ac7e273fc632?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">a.poloczek</span> <span class="commentdate"> on July 23, 2010 at 4:54 am</span> </div> <div class="comment-text"> <p>Thanks for your quick response. I am interested. Did you get my private message? Thanks for your time and maybe help.</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-14374"> <div id="comment-14374"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/5458862a9b0fd093cac29386f7a79606?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://remind.com.br/" rel="external " class="url">Ruddy</a></span> <span class="commentdate"> on July 22, 2010 at 1:15 pm</span> </div> <div class="comment-text"> <p>great post! in some wordpress i work, but in one of my websites, it was this erro: Warning: Cannot modify header information – headers already sent by (output started at /home/jc2esportes/www/site/wp-content/themes/organic_magazine/functions.php:111) in /home/jc2esportes/www/site/wp-includes/pluggable.php on line 890</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=14374#respond" onclick="return addComment.moveForm("comment-14374", "14374", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor even depth-2" id="li-comment-14380"> <div id="comment-14380"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on July 22, 2010 at 4:05 pm</span> </div> <div class="comment-text"> <p>Hmm. What is line 111 in your functions.php file?</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-14428"> <div id="comment-14428"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/5210a70f8d6499d1a1508a5c52e1c61d?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Richard</span> <span class="commentdate"> on July 23, 2010 at 4:18 pm</span> </div> <div class="comment-text"> <p>Hello, thanks for the article. I’ve been wondering how to force certain custom fields to be marked as required during the registration process?<br/> Thank you for reply.</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=14428#respond" onclick="return addComment.moveForm("comment-14428", "14428", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment even depth-2" id="li-comment-16179"> <div id="comment-16179"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/443800384482041dfb90c5b03008d5b3?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">keitai</span> <span class="commentdate"> on September 23, 2010 at 10:58 am</span> </div> <div class="comment-text"> <p>Hi Richard,</p> <p>did you find a way to make certain extra fields required/??</p> <p>regards</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-15119"> <div id="comment-15119"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/600f820fd615bb1ad6b2eb75ca962839?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Jean</span> <span class="commentdate"> on August 1, 2010 at 12:54 pm</span> </div> <div class="comment-text"> <p>Can you recommend some plugins for enabling me to add new fields to the user registration page?</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=15119#respond" onclick="return addComment.moveForm("comment-15119", "15119", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor even depth-2" id="li-comment-15325"> <div id="comment-15325"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on August 3, 2010 at 10:30 am</span> </div> <div class="comment-text"> <p>I have never used any, but you can probably search the WordPress.org plugin directory to find one that works for you.</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-15924"> <div id="comment-15924"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/41f847c4af6aebe549b70653e6b19bac?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.vicioemcamisetas.com/" rel="external " class="url">Camisetas</a></span> <span class="commentdate"> on September 5, 2010 at 5:06 pm</span> </div> <div class="comment-text"> <p>it’s compatible with wordpress 3 ?<br/> thanks, very good post dude</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=15924#respond" onclick="return addComment.moveForm("comment-15924", "15924", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment even depth-2" id="li-comment-16081"> <div id="comment-16081"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/1748dbbafd4e1282646698a7a3960c6f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">VAHID</span> <span class="commentdate"> on September 16, 2010 at 3:29 am</span> </div> <div class="comment-text"> <p>Yes it is</p> </div> </div> </li> </ul> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-16080"> <div id="comment-16080"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/1748dbbafd4e1282646698a7a3960c6f?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">VAHID</span> <span class="commentdate"> on September 16, 2010 at 3:28 am</span> </div> <div class="comment-text"> <p>Just i Want to say THANK YOU</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16080#respond" onclick="return addComment.moveForm("comment-16080", "16080", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-even depth-1" id="li-comment-16229"> <div id="comment-16229"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/490fe8fc69223dacee766db7b904c11b?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://none/" rel="external " class="url">James</a></span> <span class="commentdate"> on September 27, 2010 at 2:11 pm</span> </div> <div class="comment-text"> <p>I have tried to add checkboxes and select menus, but they always clear and cant seem to figure how to display on page.</p> <p>I need days off the week sun-sat and times 00hours to 23 hours</p> <p>anyone have sample of code for functions and author page would be helpful. thank you</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16229#respond" onclick="return addComment.moveForm("comment-16229", "16229", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-16287"> <div id="comment-16287"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/cbeabd28bc024b0c818dbf7bfa19f15b?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.crunchpixels.com.au/" rel="external " class="url">Jason</a></span> <span class="commentdate"> on October 1, 2010 at 9:01 am</span> </div> <div class="comment-text"> <p>Great post. I have been tackling this issue for a few hours, all my hacks were not playing friendly with get_author_meta(). I will implement your code and save myself another few hours of aggravation.</p> <p>The WordPress community cannot be beat for finding a solution when your brain is tired!</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16287#respond" onclick="return addComment.moveForm("comment-16287", "16287", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment even thread-even depth-1" id="li-comment-16337"> <div id="comment-16337"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/de2429f15a45d57b7bb2564a6eccf272?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">lw</span> <span class="commentdate"> on October 5, 2010 at 3:57 pm</span> </div> <div class="comment-text"> <p>I want to let the users specify whether each extra field should be public or private – the public fields would then be shown in a user directory. How can I do this?</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16337#respond" onclick="return addComment.moveForm("comment-16337", "16337", "respond", "1578")">Reply</a> </div> </div> <ul class="children"> <li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-16348"> <div id="comment-16348"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/ba043b2af6a355787f1b6fd1b1ea3eda?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/" rel="external " class="url">c.bavota</a></span> <span class="commentdate"> on October 6, 2010 at 2:00 pm</span> </div> <div class="comment-text"> <p>Hmm. Not too sure about that. What exactly are you trying to do and why?</p> </div> </div> </li> </ul> </li> <li class="comment even thread-odd thread-alt depth-1" id="li-comment-16363"> <div id="comment-16363"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://1.gravatar.com/avatar/d6c36c1fff3b830b905493fe17829fbe?s=60&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname">Conrad</span> <span class="commentdate"> on October 8, 2010 at 12:16 pm</span> </div> <div class="comment-text"> <p>I have not tried this yet, but couldn’t this be implemented as a plugin so as to avoid the loss of data/functionality when one upgrades the site’s theme? </p> <p>Okay, and now having said that – anyone want to throw out ideas on how, exactly, to achieve that?</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16363#respond" onclick="return addComment.moveForm("comment-16363", "16363", "respond", "1578")">Reply</a> </div> </div> </li> <li class="comment odd alt thread-even depth-1" id="li-comment-16506"> <div id="comment-16506"> <div class="comment-avatar"> <img alt="" src="https://web.archive.org/web/20101120004455im_/http://0.gravatar.com/avatar/4b4dc4ce0cd7357d26e8f6e47b553463?s=60&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&r=G" class="avatar avatar-60 photo" height="60" width="60"/> </div> <div class="comment-author"> <span class="authorname"><a href="https://web.archive.org/web/20101120004455/http://www.kleinermann.com.au/" rel="external " class="url">Stefan</a></span> <span class="commentdate"> on October 27, 2010 at 10:21 pm</span> </div> <div class="comment-text"> <p>Hi there,<br/> The code seems not to work in the latest version of wordpress. </p> <p>Regards,</p> <p>Stefan</p> </div> <div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/?replytocom=16506#respond" onclick="return addComment.moveForm("comment-16506", "16506", "respond", "1578")">Reply</a> </div> </div> </li> </ol> <a name="respond"></a> <div id="respond"> <h3 id="reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/#respond" style="display:none;">Cancel reply</a></small></h3> <form action="https://web.archive.org/web/20101120004455/http://bavotasan.com/wp-comments-post.php" method="post" id="commentform"> <p class="comment-notes">Your email address will not be published. Required fields are marked <span class="required">*</span></p> <p class="comment-form-author"><label for="author">Name</label> <span class="required">*</span><br/><input id="author" name="author" type="text" value="" size="30"/></p> <p class="comment-form-email"><label for="email">Email</label> <span class="required">*</span><br/><input id="email" name="email" type="text" value="" size="30"/></p> <p class="comment-form-url"><label for="url">Website</label><br/><input id="url" name="url" type="text" value="" size="30"/></p> <p>To enter code in the comment box, please place it between <strong><pre lang="php"> </pre></strong> tags. You don't have to convert any characters to their hex/HTML code. Just add your code the way you would to any code editor.</p> <p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p> <p class="form-submit"> <input name="submit" type="submit" id="submit" value="Post Comment"/> <input type="hidden" name="comment_post_ID" value="1578" id="comment_post_ID"/> <input type="hidden" name="comment_parent" id="comment_parent" value="0"/> </p> </form> </div><!-- #respond --> </div><!-- #comments --> </div> </div> <!-- begin sidebar --> <div id="sidebar"> <div id="search"> <form method="get" id="searchform" action="https://web.archive.org/web/20101120004455/http://bavotasan.com/"> <div> <input type="text" class="search_input" value="Search" name="s" id="s" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search';}"/> <input type="hidden" id="searchsubmit" value="Search"/> </div> </form> <div class="arrow"></div> </div> <div id="sideads"> <!-- BuySellAds.com Zone Code --> <div id="bsap_1237633" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div> <!-- END BuySellAds.com Zone Code --> <br class="clear"/> <!-- BuySellAds.com Zone Code --> <div id="bsap_1237624" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div> <!-- END BuySellAds.com Zone Code --> </div> <br class="clear"/> <div class="line"></div> <div class="side-widget"> <h4>Most Popular Posts</h4> <ul class="wppp_list"> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/creating-a-jquery-mouseover-fade-effect/" title="Creating a Mouseover Fade Effect with jQuery ">Creating a Mouseover Fade Effect with jQuery </a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/a-simple-mouseover-hover-effect-with-jquery/" title="A Simple Mouseover Hover Effect with jQuery">A Simple Mouseover Hover Effect with jQuery</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/" title="Full Size Background Image jQuery Plugin">Full Size Background Image jQuery Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/" title="Magazine Basic v2.6 WordPress Theme">Magazine Basic v2.6 WordPress Theme</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/processing-multiple-forms-on-one-page-with-php/" title="Processing Multiple Forms on One Page with PHP">Processing Multiple Forms on One Page with PHP</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/6-free-vinyl-record-vectors/" title="6 Free Vinyl Record Vectors">6 Free Vinyl Record Vectors</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/how-to-create-a-twitter-feed-on-your-web-site/" title="How to Create a Twitter Feed on Your Web Site">How to Create a Twitter Feed on Your Web Site</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/php-code-to-redirect-mobilehandheld-users/" title="PHP Code to Redirect Mobile/Handheld Users">PHP Code to Redirect Mobile/Handheld Users</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/" title="Excerpt or Content Word Limit in WordPress: Redux">Excerpt or Content Word Limit in WordPress: Redux</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-extra-fields-to-the-wordpress-user-profile/" title="Adding Extra Fields to the WordPress User Profile">Adding Extra Fields to the WordPress User Profile</a></li> </ul> </div> <div id="affiliates-ads"> <a href="https://web.archive.org/web/20101120004455/http://themes.bavotasan.com/" class="themes"></a> <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/delete-duplicate-posts-pro-wordpress-plugin/" class="deletedupes"></a> <a href="https://web.archive.org/web/20101120004455/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest&page=7" class="inmotion"></a> </div> <div class="line"></div> <div class="side-widget redlink"> <h4>Get a Premium Theme for FREE</h4> <p><a href="https://web.archive.org/web/20101120004455/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest" class="wordpress-logo"></a>Don't have a Web site? How would you like to have WordPress and a <a href="https://web.archive.org/web/20101120004455/http://themes.bavotasan.com/category/premium-themes">Themes by bavotasan.com</a> Premium theme installed and configured for <em>FREE</em>? All you need to do is <a href="https://web.archive.org/web/20101120004455/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest">sign up with InMotion Hosting through this link</a>. <br/> <br/> <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/free-premium-theme/" class="fr"><em>Click here for more information »</em></a> </p> </div> <div class="side-widget"> <h4>Support c.bavota</h4> <p>If you would like to support <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/">c.bavota</a> and <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/">bavotasan.com</a>, please use the donate link below. Any amount, even $1.00, is appreciated (a man's gotta eat, ya know).</p> <a href="https://web.archive.org/web/20101120004455/https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5745952" id="donate" class="fr">Donate</a> </div> </div> <!-- end sidebar --></div> </div> <!-- begin footer --> <div class="whiteline"></div> <div id="footer"> <div id="bottombar"> <a href="javascript:void(0)" class="backtotop">Back to Top<span></span></a> <div class="col col1"> <h4 class="one"><span></span>Stay in Touch</h4> <a href="https://web.archive.org/web/20101120004455/http://twitter.com/bavotasan" class="footer-twitter"><span></span>Follow me on Twitter</a><br/> <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/feed/" class="footer-rss"><span></span>Subscribe to my RSS Feed</a> <br class="clear"/> <h4 class="two"><span></span>Stay in Tune</h4> <div class="tweets"></div> </div> <div class="col col2"> <h4 class="three"><span></span>Downloads</h4> <ul> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/my-first-vanilla-plugin/">My First Vanilla Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/delete-duplicate-posts-pro-wordpress-plugin/">Delete Duplicate Posts Pro WordPress Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/feed-me-seymour-free-wordpress-theme/">Feed Me, Seymour 1.2</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/">Magazine Basic v2.6 WordPress Theme</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/sliderota-jquery-plugin/">Sliderota jQuery Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/">Full Size Background Image jQuery Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/easy-overlay-modal-window-jquery-plugin/">Easy Overlay Modal Window jQuery Plugin</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/snowblind-free-wordpress-theme/">Snowblind v1.1.2 Free WordPress Theme</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/8-free-colorful-background-textures-for-designers/">8 Free Colorful Background Textures for Designers</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/downloads/stationery-premium-wordpress-theme/">Stationery Premium WordPress Theme</a></li> </ul> </div> <div class="col col3"> <h4 class="four"><span></span>Tutorials</h4> <ul> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/add-a-copyright-notice-to-copied-text/">Add a Copyright Notice to Copied Text</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/meta-descriptions-wordpress/">Meta Descriptions for WordPress</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/turning-on-php-errors/">Turning On PHP Errors</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/using-css-resets/">Using CSS Resets</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/a-sleek-navigation-menu-with-css3/">A Sleek Navigation Menu with CSS3</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/a-basic-jquery-slideshow/">A Basic jQuery Slideshow</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/text-rotation-css3/">Text Rotation with CSS3</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/adding-tweet-button-wordpress/">Adding a Tweet Button to WordPress</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/developing-themes-for-wordpress-make-money/">Developing Themes for WordPress: Part 5</a></li> <li><a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/tutorials/developing-themes-for-wordpress-options/">Developing Themes for WordPress: Part 4</a></li> </ul> </div> </div> </div> <div id="copyright"> <div id="copyright-wrapper"> Copyright © 2010 <a href="https://web.archive.org/web/20101120004455/http://bavotasan.com/">bavotasan.com</a>. All Rights Reserved. Powered by <a href="https://web.archive.org/web/20101120004455/http://www.wordpress.org/">WordPress</a>. </div> </div> <!--stats_footer_test--><script src="https://web.archive.org/web/20101120004455js_/http://stats.wordpress.com/e-201046.js" type="text/javascript"></script> <script type="text/javascript"> st_go({blog:'5317602',v:'ext',post:'1578'}); var load_cmc = function(){linktracker_init(5317602,1578,2);}; if ( typeof addLoadEvent != 'undefined' ) addLoadEvent(load_cmc); else load_cmc(); </script> <script type="text/javascript" src="https://web.archive.org/web/20101120004455js_/http://bavotasan.com/wp-content/themes/bavotasan-2010/js/coolstuff.js"></script> <script type="text/javascript"> hs.graphicsDir = 'https://web.archive.org/web/20101120004455/http://bavotasan.com/images/graphics/'; hs.outlineType = 'rounded-white'; hs.outlineWhileAnimating = true; hs.showCredits = false; </script> <!-- Bavota San 2010 theme designed by c.bavota, http://bavotasan.com --> </body> </html> <!-- Dynamic page generated in 1.738 seconds. --> <!-- Cached page generated by WP-Super-Cache on 2010-11-17 11:38:58 --> <!-- super cache --><!-- FILE ARCHIVED ON 00:44:55 Nov 20, 2010 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 09:34:10 Nov 29, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.87 exclusion.robots: 0.056 exclusion.robots.policy: 0.042 esindex: 0.016 cdx.remote: 40.257 LoadShardBlock: 277.108 (3) PetaboxLoader3.resolve: 297.088 (4) PetaboxLoader3.datanode: 127.292 (4) load_resource: 270.372 -->