Skip to content

Instantly share code, notes, and snippets.

@strsar
Created October 7, 2021 01:41
Show Gist options
  • Save strsar/bd5f78c82e217746be8d8abbcaf9e848 to your computer and use it in GitHub Desktop.
Save strsar/bd5f78c82e217746be8d8abbcaf9e848 to your computer and use it in GitHub Desktop.
[WP] An unfortunate way to cleanup user profiles...
<?php defined('ABSPATH') or header('Location: /');
/**
* Yup... really the only way... display:none
*/
add_action('admin_head', 'remove_edit_profile_fields_css');
function remove_edit_profile_fields_css() {
echo "<style>
/**
* Remove Visual Editor Option
*/
#profile-page .user-rich-editing-wrap {
display: none;
}
/**
* Remove Keyboard Shortcuts Option
*/
#profile-page .user-comment-shortcuts-wrap {
display: none;
}
/**
* Remove Toolbar Option
*/
/** #profile-page .user-admin-bar-front-wrap {
display: none;
} */
/**
* Remove Syntax Highlighting
*/
#profile-page .user-syntax-highlighting-wrap {
display: none;
}
</style>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment