Created
May 21, 2013 23:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// **************************************************** | |
// 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