21

There is no dedicated hook – user management is a low priority in WordPress. You have to use output buffering (yes, not nice). Here is a simple demonstration how this could be done: add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) ); /** * Captures the part with the biobox in an output buffer and removes it. * * @author ...


20

For an author's profile link, use bp_core_get_user_domain( $user_id ) to get the URL, and bp_core_get_userlink( $user_id ) to get an HTML link element, including display name. For the xprofile data, use xprofile_get_field_data( $field, $user_id ) $field can be either the name of the field (like 'Biography') or the numerical field id.


15

For the contact methods filter: user_contactmethods: function update_contact_methods( $contactmethods ) { unset( $contactmethods['aim'] ); unset( $contactmethods['jabber'] ); unset( $contactmethods['yim'] ); return $contactmethods; } add_filter( 'user_contactmethods', 'update_contact_methods' );


15

There are two ways I've discovered doing this: Author Page with a custom rewrite rule A custom template files paired with a rewrite rule The first is more simple to implement, but may not work in all circumstances (one of which I'll describe soon). Custom Rewrite Rule I found this solution a few days ago here: URL Rewriting And here's the code, with ...


13

If you plan to use this code on frontend, I would check if email is free to use. Otherwise, you are creating a security hole. if (isset( $_POST['email'])) { // check if user is really updating the value if ($user_email != $_POST['email']) { // check if email is free to use if (email_exists( $_POST['email'] )){ // ...


12

You need to use wp_update_user() for the email, as it is not user-meta but core user data. The code should look something like this: $args = array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['user_email'] ) ); wp_update_user( $args ); Note: that's untested, but it should work out of the box.


11

Revisited and updated answer: We can't use the user_contactmethods filter to remove the website wrapper, because this piece is hardcoded in the user-edit.php file and not part of the filterable user contacts loop, generated by: wp_get_user_contact_methods( $profileuser ) Hiding it with CSS The website row element now got it's own .user-url-wrap class: ...


11

You technically don't have to set a nickname, it will be filled with your username if you clear the field out. Display name is selectable between the user's username, first name, last name, first/last, or last/first, or nickname. The nickname exists to give you an option to set display name to something other than your username or real name.


9

Though the user_contactmethods filter is the one of the few for the user profile screen, since the other fields are not required in WordPress, you could use jQuery's .hide() and .remove() to effectively get rid of the ones you don't want without complications in terms of saving the information. Sure, a person without JS on would still see them, but that's a ...


9

Default WordPress uses Gravatar, you can find more information about it here. On WordPress.com, we use Gravatar to associate an avatar with a user’s account. If you’ve set up a Gravatar, it will be displayed when you post to the forums or comment on a blog, and it may also appear if your blog is featured on a tag page. Custom - Backend If you manually ...


9

Redirect from profile.php to the dashboard Here's one way to do it: add_action( 'load-profile.php', function() { if( ! current_user_can( 'manage_options' ) ) exit( wp_safe_redirect( admin_url() ) ); } ); where we redirect to the dashboard instead, if the current user can't manage options. Redirect from profile.php to the current user's member ...


8

Place the following code in your functions.php <?php add_action( 'show_user_profile', 'show_extra_profile_fields' ); add_action( 'edit_user_profile', 'show_extra_profile_fields' ); function show_extra_profile_fields( $user ) { ?> <h3>Extra profile information</h3> <table class="form-table"> &...


8

great answer, to take this a step further and for anyone looking to apply this to all non-admin users (e.g. contributers, editors etc.) // ===== remove edit profile link from admin bar and side menu and kill profile page if not an admin if( !current_user_can('activate_plugins') ) { function mytheme_admin_bar_render() { global $wp_admin_bar; $...


7

Since the recent class change this works: add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) ); /** * Captures the part with the biobox in an output buffer and removes it. * * @author Thomas Scholz, <info@toscho.de> * */ class T5_Hide_Profile_Bio_Box { /** * Called on 'personal_options'. * * @return ...


7

function mytheme_admin_bar_render() { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); } add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); For specific user roles you can wrap the add_action in a conditional, something like if(current_user_can('editor')){ add_action( 'wp_before_admin_bar_render', '...


7

As far as I'm aware, all you can do is filter the display name via pre_user_display_name and check if it already exists. Unfortunately WP_User_Query doesn't support querying by display_name, so we also have to add to the WHERE clause via pre_user_query. Additionally, there is no elegant way I can think of to handle the case where the display_name already ...


6

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 ...


6

Was just trying to figure this out and came across this answer. The above code by Cor van doesn't work anymore, but with a slight change of the add_action, it can. All you need to do is change the last two lines from: add_action( 'admin_head-profile.php', 'cor_profile_subject_start' ); add_action( 'admin_footer-profile.php', 'cor_profile_subject_end' ); ...


6

You are missing the "checked" value for the inputs <input type="checkbox" name="language" <?php if (get_the_author_meta( 'language', $user->ID) == 'Mandarin' ) { ?>checked="checked"<?php }?> value="Mandarin" /> Mandarin<br /> Also, the usermeta is dealing but your are checking for $_POST['gender'] Finally, you should have one ...


6

You should (if available) submit the code you are working with, even if just a snippet, so we can assess your process in relation to your question. The short answer however is YES, it is safe, so long as you, prevent input fields being displayed on user profile page for certain user roles prevent unauthorized users from saving user meta to the database ...


6

There is a global variable called … $user_id available on that page. Always. From user-edit.php: $user_id = (int) $user_id; $current_user = wp_get_current_user(); if ( ! defined( 'IS_PROFILE_PAGE' ) ) define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) ); if ( ! $user_id && IS_PROFILE_PAGE ) $user_id = $current_user->ID; ...


6

Presuming that the user has their avatar saved, as the ID of an attachment, store in user meta, as the field field_with_custom_avatar_id, you could do this to show that attachment if the value is saved: add_filter( 'get_avatar', 'slug_get_avatar', 10, 5 ); function slug_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) { //If is email, try ...


5

Solution as a (MU-)Plugin I checked all the provided solutions and thought I could make a nice MU-Plugin out of it. The only real change is that it avoids <?php ! defined( 'ABSPATH' ) AND exit; /** * Plugin Name: Disable profile page link * Description: Remove edit profile link from admin bar and side menu and kill profile page if user isn't an ...


5

Worked it out with a bit of time. Here is the code I am using: <?php /* Plugin Name: Restrict User Editing Own Profile Plugin URI: http://www.philosophydesign.com Description: Restricts users from editing their own profile information. Author: Scott Cariss Version: 0.1 Author URI: http://www.philosophydesign.com/scott-cariss.html */ add_action( '...


5

You should hook into the user_register action. I did something similar on a recent site (not involving having to fill out profile fields, but involving having to renew a membership). I will propose a multi-part solution (let me know if any of it is confusing, it's been a long day and I might not explain it perfectly). EDIT: Upon thinking about it further, ...


5

Accepted answer is not working with 4.8 Here comes an up to date and simplified code that should work with any version: // removes admin color scheme options remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); //Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options. ...


5

It's entirely possible that you are calling the_author_meta() from outside of your post loop in the author.php template in which case the above will not work. Instead, you can use get_the_author_meta('facebook') or... get_the_author_meta('facebook', $user_id) where $user_id is the ID# of the current user/author. To get the user ID you can do this; <...


5

Files named "core" are created when some OS process crashes. In your case it was likely a crash of the php interpreter. These files being memory dumps are used to debug the process "postmortem" - e.g. to check in which function did it fail, so it is perfectly safe to delete them if you are not going to debug the issue. In fact, on many systems there is a ...


5

You can do this using either the personal_options_update or edit_user_profile_update hook depending on what exactly you want to do. If those aren't firing when you need, you can poke around in http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/user-edit.php to find a different hook to use. See Justin Tadlock's tutorial for more


Only top voted, non community-wiki answers of a minimum length are eligible