Last active
February 22, 2018 21:31
-
-
Save mannieschumpert/6105148 to your computer and use it in GitHub Desktop.
Remove unneeded User settings fields in WordPress
This file contains hidden or 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
<?php | |
// Hook into the admin footer | |
add_action( 'admin_footer-user-edit.php', 'remove_user_fields' ); | |
// Print jQuery that removes unneeded elements | |
function remove_user_fields(){ | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready( function($) { | |
var ids = ['#rich_editing', // Rich editing button | |
'#admin_color_classic', // Admin color scheme | |
'#comment_shortcuts', // Keyboard shortcuts for comment moderation | |
'#aim', // AOL instant messenger | |
'#yim', // Yahoo messenger | |
'#jabber', // Jabber | |
'#description']; // User bio | |
for (var i = 0; i < ids.length; i++) { | |
$(ids[i]).closest('tr').remove(); | |
} | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in wordpress
4.9
, the following is needed: