Allow Profile HTML for select users

You can hook on an early action and apply the filter for your use case: add_action( ‘load-profile.php’, ‘allow_profile_html_wpse_91564’ ); function allow_profile_html_wpse_91564() { global $current_user; if( ‘2’ == $current_user->ID ) remove_filter(‘pre_user_description’, ‘wp_filter_kses’); } The hook load-$pagenow runs in all default admin pages (i.e., not added by a third party), and it’s declared in the file /wp-admin/admin.php. … Read more

Upload gravatar in WP profile?

If you are looking to connect your sites sign-up with Gravatar then you simply can’t, since Gravatar don’t have a sing-up api you can use. But if you are just looking to let your users upload there own photos the either Simple Local Avatars Plugin that Chip suggested or one I’ve used a lot before … Read more

Connect Users and Taxonomies

I came across a tutorial about ‘Custom User Taxonomies in WordPress‘ and there is a plugin based on that ‘User Taxonomies‘ but these are for creating taxonomies for Users. Have a read thought the tutorial it might help. I think what you’re talking about is to associating posts’ taxonomies with users. I think you need … Read more

How do I remove the ‘Show Toolbar’ option?

Here’s one way to hide it with CSS: add_action( ‘personal_options’, function( $profileuser ) { ?><style>.show-admin-bar{ display: none;}</style><?php } ); or rather place it within the <head>…</head> with: add_action( ‘admin_print_styles-user-edit.php’, ‘wpse_hide_admin_bar_settings’ ); add_action( ‘admin_print_styles-profile.php’, ‘wpse_hide_admin_bar_settings’ ); function wpse_hide_admin_bar_settings() { ?><style>.show-admin-bar{ display: none;}</style><?php } You could perhaps add your own wpse_hide_admin_bar_settings filter if you need more control: … Read more

Different fields in My Profile page depending on user role

I’ll post whole code which have to be in functions.php it’s legit WP valid code, how it should be done 🙂 This should work, of course you have to put your role name in switch. UPDATED FOR PERFORMANCE: add_action( ‘show_user_profile’, ‘user_fields_for_admin’, 10); add_action( ‘edit_user_profile’, ‘user_fields_for_admin’, 10); function user_fields_for_admin( $user ){ switch ($user->roles[0]) { case ‘SOME … Read more

How to add checkbox and radio button in Profile Page

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 usermeta for English and other for Mandarin, as they are not mutually … Read more

Get attachment ID of author_meta image – Attachment Metadata

I suggest you to use the more newer media manager dialog; WordPress will hanlde all the image upload stuff, including generating intermediate sizes and attachement metadata. Here a working example (it is a quick example built from a previous code, it may needs some tweaks to be used on production): add_action( ‘admin_enqueue_scripts’, ‘load_wp_media_files’ ); function … Read more