Skip to content

Instantly share code, notes, and snippets.

@kimsible
Last active September 15, 2020 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimsible/4bef7bdfcdc5701254bba8c239c98828 to your computer and use it in GitHub Desktop.
Save kimsible/4bef7bdfcdc5701254bba8c239c98828 to your computer and use it in GitHub Desktop.
WordPress - Snippet - Remove unused profile edit page fields
if (is_admin() && !current_user_can('administrator')) {
add_action('profile_personal_options', 'remove_profile_fields');
function remove_profile_fields() {
?>
<style>
#your-profile h2, /* hide profile titles */
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap,
.user-admin-color-wrap,
.user-comment-shortcuts-wrap,
.show-admin-bar,
.user-admin-bar-front-wrap,
.user-language-wrap,
/* begin - hide names fields for static sites */
.user-first-name-wrap,
.user-last-name-wrap,
.user-nickname-wrap,
.user-display-name-wrap,
/* end - hide names fields for static sites */
.user-url-wrap,
.user-description-wrap,
.user-profile-picture {
display: none;
}
</style>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment