Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ckaklamanos/3cc39e8de3b8b0105d361deb44ec25e2 to your computer and use it in GitHub Desktop.
Save ckaklamanos/3cc39e8de3b8b0105d361deb44ec25e2 to your computer and use it in GitHub Desktop.
WordPress: Hide "Personal Options" section from User Edit screen (for non-Administrators)
<?php
function fn_hide_personal_options_section_from_user_edit_screen(){
echo '<script>jQuery(document).ready(function($) {
$(".user-edit-php .user-admin-color-wrap").closest(".form-table").hide();
$(".user-edit-php .user-admin-color-wrap").closest(".form-table").prev("h2").hide();
} ); </script>';
}
if (!current_user_can('manage_options')) {
add_action('admin_head','fn_hide_personal_options_section_from_user_edit_screen');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment