glebec
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Discussion-based email list from WP users?Thanks both of you. I think I have some leads now, enough to research at any rate.
Forum: Fixing WordPress
In reply to: Remove the “bio” section from user profile?SUCCESS! Had to buckle down and learn the basics of regular expressions, but here was my solution. Add this to your functions.php:
<?php // Callback function to remove default bio field from user profile page function remove_plain_bio($buffer) { $titles = array('#<h3>About Yourself</h3>#','#<h3>About the user</h3>#'); $buffer=preg_replace($titles,'<h3>Password</h3>',$buffer,1); $biotable='#<h3>Password</h3>.+?<table.+?/tr>#s'; $buffer=preg_replace($biotable,'<h3>Password</h3> <table class="form-table">',$buffer,1); return $buffer; } function profile_admin_buffer_start() { ob_start("remove_plain_bio"); } function profile_admin_buffer_end() { ob_end_flush(); } add_action('admin_head', 'profile_admin_buffer_start'); add_action('admin_footer', 'profile_admin_buffer_end'); ?>
This is a very iron-fisted method of admin page editing, however, and is strongly dependent on future WP updates not changing the format or text of the user admin page. So it’s really an ugly hack if there ever was one. But it should be very easy to update if you know (or can give yourself a crash course in) regular expressions.
Hope this helps someone else,
-GLForum: Fixing WordPress
In reply to: Remove the “bio” section from user profile?FYI I’m working on this by attaching some php output buffering code to the admin_head and admin_footer action hooks. I’m then trying to filter the buffer using regular expressions. This seems like a relatively hardcore method however, plus I only just started experimenting with regex so it’s a bit tricky. I welcome any input.