Skip to content

Instantly share code, notes, and snippets.

@khleomix
Created August 20, 2024 21:05
Show Gist options
  • Save khleomix/91c85dad8cbd74396005a347a6dd1858 to your computer and use it in GitHub Desktop.
Save khleomix/91c85dad8cbd74396005a347a6dd1858 to your computer and use it in GitHub Desktop.
WP User Profile Customization
// Define the function to customize user profile fields
function customize_user_profile_fields() {
?>
<style type="text/css">
/* Remove optional fields from the user profile page */
#your-profile .form-table:first-of-type,
#your-profile h3:first-of-type,
#your-profile .user-nickname-wrap,
#your-profile .user-url-wrap,
#your-profile .user-display-name-wrap,
h2:contains("About Yourself"),
.user-description-wrap {
display: none;
}
</style>
<?php
}
// Hook the function into 'personal_options' action
add_action('personal_options', __NAMESPACE__ . '\customize_user_profile_fields');
// Remove the theme color picker from the admin dashboard
remove_action('admin_color_scheme_picker', 'admin_color_scheme_picker');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment