Created
August 20, 2024 21:05
-
-
Save khleomix/91c85dad8cbd74396005a347a6dd1858 to your computer and use it in GitHub Desktop.
WP User Profile Customization
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
// 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