Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide contact fields from profile in admin interface & remove personal options from profile page in admin interface
// ****************************************************
// Hide contact fields from profile in admin interface
// ****************************************************
add_filter( 'user_contactmethods', 'update_contact_methods',10,1);
function update_contact_methods( $contactmethods ) {
unset($contactmethods['aim']);
unset($contactmethods['jabber']);
unset($contactmethods['yim']);
return $contactmethods;
}
// ****************************************************
// remove personal options from profile page in admin interface
// ****************************************************
if(is_admin()){
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
add_action( 'personal_options', 'prefix_hide_personal_options' );
}
function prefix_hide_personal_options() {
?>
<script type="text/javascript">
jQuery(document).ready(function( $ ){
$("#your-profile .form-table:first, #your-profile h3:first").remove();
$("#nickname,#display_name").parent().parent().remove();
$("#description").parent().parent().remove();
});
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment