Skip to content

Instantly share code, notes, and snippets.

@hlotvonen
Created May 21, 2013 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlotvonen/5624060 to your computer and use it in GitHub Desktop.
Save hlotvonen/5624060 to your computer and use it in GitHub Desktop.
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