Want to remove Biography from user profile admin page in WordPress? Use following code in your theme’s functions.php file OR in site specific plugin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | /** * Captures the part with the biobox in an output buffer and removes it. * * @author Thomas Scholz, <[email protected]> * */ class T5_Hide_Profile_Bio_Box { /** * Called on 'personal_options'. * * @return void */ public static function start() { $action = ( IS_PROFILE_PAGE ? 'show' : 'edit' ) . '_user_profile'; add_action( $action, array ( __CLASS__, 'stop' ) ); ob_start(); } /** * Strips the bio box from the buffered content. * * @return void */ public static function stop() { $html = ob_get_contents(); ob_end_clean(); // remove the headline $headline = __( IS_PROFILE_PAGE ? 'About Yourself' : 'About the user' ); $html = str_replace( '<h2>' . $headline . '</h2>', '', $html ); // remove the table row $html = preg_replace( '~<tr>\s*<th><label for="description".*</tr>~imsUu', '', $html ); print $html; } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.