Last active
July 31, 2023 15:55
-
-
Save dkomando/6214787a8d36d9f13c9b to your computer and use it in GitHub Desktop.
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
// Callback function to remove default bio field from user profile page & re-title the section | |
// ------------------------------------------------------------------ | |
// Thanks to original code found here: https://wordpress.org/support/topic/remove-the-bio-section-from-user-profile | |
// More reference: http://wordpress.stackexchange.com/questions/49643/remove-personal-options-section-from-profile | |
// Alternate examples: http://wordpress.stackexchange.com/questions/38819/how-to-remove-biography-from-user-profile-admin-page | |
if(!function_exists('remove_plain_bio')){ | |
function remove_bio_box($buffer){ | |
$buffer = str_replace('<h3>About Yourself</h3>','<h3>User Password</h3>',$buffer); | |
$buffer = preg_replace('/<tr class=\"user-description-wrap\"[\s\S]*?<\/tr>/','',$buffer,1); | |
return $buffer; | |
} | |
function user_profile_subject_start(){ ob_start('remove_bio_box'); } | |
function user_profile_subject_end(){ ob_end_flush(); } | |
} | |
add_action('admin_head-profile.php','user_profile_subject_start'); | |
add_action('admin_footer-profile.php','user_profile_subject_end'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. I'm inserting a custom WYSIWYG field to allow for links in the bio, so I needed this.
I'm guessing
if(!function_exists('remove_plain_bio')){
should be
if(!function_exists('remove_bio_box')){
?