About Me Widget for WordPress 2.8.x, or Embeding tinyMCE in a WordPress Widget

Hey gang,

Just a quick update to let you all know that I just updated the about me widget over at codex to be compatible with the new WordPress Widget API. I decided to contact Sam and get access to the repository on codex, rather than host the download on my blog locally. Feel free to discuss installation or other issues in here.

I bumped the number up to 2.0 since it was a complete re-write to make it work in the new Widget API. The new API makes it incredibly easy to write regular widgets, but incredibly difficult to write plugins that require rich controls that use their own kind of ajax, tinyMCE being the candidate in this instance.

I had to do some very evil things to make the tinyMCE editor able to save it’s html into the textarea on the save button click event (since that triggers the ajax postback, not the form submit event that tinyMCE is watching for).

I also had to do some very bad things with respect to page loading and click event binding to get tinyMCE control to survive the ajax widget re-ording events. Apparently drag-and-drop destroys the underlying controls in the widget div which leaves the tinyMCE editor orphaned with no active window. The only way I was able to work around this issue was to bind the widget settings button (the down arrow) click event and literally remove the editor from the DOM, using jQuery().remove() and then re-init the editor and show it.

This is the only way i was able to get the tinyMCE editor able to both survive a sort event, and bind to the textarea. I don’t like because it means everyvtime you try to edit the about me widget you have destroy and re-create the tinyMCE editor and rebind it to the textarea. It works, it’s just not clean.

I suspect the WordPress dev’s will be changing the API to give it more hooks and mature it’s ajaxy-ness as time goes on.

Plugin link: http://wordpress.org/extend/plugins/about-me-widget/

9 Responses to “About Me Widget for WordPress 2.8.x, or Embeding tinyMCE in a WordPress Widget”


  • Thank you so much for updating this plugin. I really appreciate it. I’m surprised there aren’t more About Me plugins with similar functionality really.

    I can now drag and drop the widget to the sidebar and everything displays properly. Unfortunately, none of the buttons work and I can’t enter anything into the textfield. I’m running WP 2.8.4 with the Thesis theme.

  • Hi Geoffrey,
    The symptoms you’re describing sound the same as those that caused me many wasted hours trying to resolve widget sorting issues. I can’t actually reproduce them as you’ve described but can I ask that you try the following and report back?

    1. Add the widget to the side bar anywhere.
    2. Save the widget to the sidebar (should automatically happen on drop).
    3. Reload the widgets page http://(your wp blog url)/wp-admin/widgets.php
    4. On reload open up the about me widget and try to edit the text then.

    I was able to make the widget work immediately after a complete page refresh, which is what I’m suggesting you try here.

    Also could you please note which browser version you’re using that’s causing issues?

  • this is a relatively new site that I am developing a new look for http://www.cookingsalmon.net. I was able to load the widget. The widget shows up in the sidebar with the title. I can enter text after page refresh but save wipes the text or picture out. closing the widget leaves the text there but it does not display in the sidebar widget. the box is empty if I leave the widget page and comeback

  • Thanks, thanks, thanks for this plugin!
    It works very well. The only proplem is the styles button… It not import so much.
    A question: can I personalized the title styles of the text? I intend where there is “about me” defoult write.

    Thanks again,
    Salvatore.

  • The title field is designed to be rendered in exactly the same style as all the other sidebar titles to keep it looking consistent.

    So if you want to change the title style, you’re going to have to modify your theme style.

  • Thanks, JBA. I refreshed the browser and everything seems to be working now except the “Style” dropdown menu. I’m using Google Chrome (not Chromium) for Linux.

  • Looks like the update to 2.9 broke the widget.

  • Think I have a local fix. It now involves 3 dirty hacks and it’s likely the next release will break it. I’m going to try and make contact with the WP devs instead and try and get them to design the widget screen to facilitate the binding of custom edit and save events. It’s the cleaner solution.

  • As per this post, I now have published the changes to make the widget work in WordPress 2.9, and bumped the plugin version to 2.1. Enjoy.

Leave a Reply