Last active
January 25, 2020 14:04
-
-
Save ckaklamanos/3cc39e8de3b8b0105d361deb44ec25e2 to your computer and use it in GitHub Desktop.
WordPress: Hide "Personal Options" section from User Edit screen (for non-Administrators)
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
<?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