Last active
September 15, 2020 11:43
-
-
Save kimsible/4bef7bdfcdc5701254bba8c239c98828 to your computer and use it in GitHub Desktop.
WordPress - Snippet - Remove unused profile edit page fields
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
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