How to use tinyMCE for user “biographical info”?

I found a very helpful blog post which shows exactly how to accomplish what I am after with only three small changes to the user-edit.php page.

First Change

I had to add a class name to the <textarea> tag for the description.

<textarea name="description" id="description" rows="5" cols="30"
  class="CLASS_NAME_HERE"><?php echo esc_html($profileuser->description); ?>
</textarea><br />

Second Change

I had to add a function call to wp_tiny_mce() like so.

<?php wp_tiny_mce( false, array( "editor_selector" => "CLASS_NAME_HERE" )); ?>

Note, the first argument of wp_tiny_mce (if true) will display the really stripped down version of the editor (like you’d see on the Quick Post).

Third Change

By default, WordPress will strip out certain tags (those defined in $allowedtags) from the user description field. So, I found a plugin which basically removes the html restrictions. The plugin is called Weasel’s Html Bios.

Leave a Comment