0

I've been hunting for the hook to edit the Biographical info field and it's H3 but no luck. I've found edit_user_{$field} do specific hooks exist?

I'm thinking I can hook into the existing tag 'description'? Thanks in advance.

edit_user_profile('description', 'change_description');
function change_description(){
// something here?
}
2
  • have you seen this?
    – fuxia
    Mar 8, 2013 at 20:29
  • If you've included a solution in your edit, it's better to instead answer your own question, then later mark is as accepted answer. It's more clear that way. Mar 8, 2013 at 21:00

1 Answer 1

0

thanks @toscho

A quick tweak on toscho's Remove Bio Box code

add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) );
/**
 * 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' );
    $replacement = 'About The Author Box';
    $html = str_replace( '<h3>' . $headline . '</h3>', '<h3>' . $replacement . '</h3>', $html );

    // remove the table row
    // $html = preg_replace( '~<tr>\s*<th><label for="description".*</tr>~imsUu', '<th><label for="description"</tr>', $html );
    $html = str_replace( 'Biographical Info', 'Short Author Bio', $html );
    print $html;
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.