Add and Remove fields in Profile page

This answer is copied from the best post over this topic! I could’ve just given you the links, but that would get me a comment from the mod to post sample code 😉 For adding the fields: 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 ) { ?> <h3>Extra profile information</h3> <table … Read more

How to get all possible arguments for a wordpress function

I think you are confusing function arguments with author (user) meta fields. To get all user meta fields you can use get_user_meta() with empty $key parameter. For example, for user with ID 45: $user_meta = get_user_meta( 45 ); $user_meta will be an array with all meta fields for the user with ID = 45.

Custom Profile Field for

I think you want something like this: <textarea type=”text” name=”twitter” id=”twitter” class=”regular-text”><?php echo esc_attr( get_the_author_meta( ‘twitter’, $user->ID ) ); ?></textarea> Note, the input field has a value attribute while the textarea has it’s content between <textarea> and </textarea>

How to Create a User Profile Page?

Based on your comments, you should choose option 2 (using special template files). You can do that multiple ways, but I suggest you do the following: Create a plugin that will setup login, register, retrieve password, profile, delete account, and other related pages; (there will be a lot of pages). Creating a plugin is just … Read more

How do I add a dropdown list of numbers 1 – 1000 as an extra profile field?

you can save the 1000 conditional checks by using str_replace and your code would be much more efficient, something like this: //create the select options $options=””; for($i=1;$i<=1000;$i++) { $options.= ‘<option value=”‘.$i.'”>’.$i.'</option>’; } //get the saved data $saved = get_the_author_meta( ‘number_pick’, $user->ID ); $saved = (!empty($saved))? $saved: false; if ($saved) //if there is a saved data … Read more

Display Custom Field for a Specific Role, but not for Admin

You can use the WP_User class and the has_cap($role) method. The show_user_profile action passes a WP_User object as a parameter to the called function. http://codex.wordpress.org/Class_Reference/WP_User#has_cap.28.24cap.29 add_action(‘show_user_profile’, ‘my_add_extra_profile_fields’); function my_add_extra_profile_fields($user) { if ($user->has_cap(‘subscriber’)) { //Code here } }

Buddypress export Profile Fields [closed]

Since the asker really doesn’t want to post the answer … someone has to do it: SELECT wp_users.ID , wp_users.user_email FROM wp_users LEFT JOIN wp_bp_xprofile_data ON wp_bp_xprofile_data.user_id = wp_users.ID, WHERE wp_bp_xprofile_data.field_id = 8 AND wp_bp_xprofile_data.value=”yes” field_id = 8 being the Field you want to get (in my example, newsletter) wp_bp_xprofile_data.value=”yes”, being the value of the … Read more