Shortcodes in widgets

I just switched to this new theme, and I wanted to transfer over the customizations I made to the last theme. I was a WordPress n00b when I started the blog, and I did not initially use widgets. To transfer all my customizations over, I knew widgets would be the way to do it.

I have the Last.fm plugin, and I made mods to my sidebar.php file to include it before. All I needed to do this time was put the shortcode in a text widget, right? WRONG! I knew there had to be a way.

A quick google revealed this post on using shortcodes in widgets. It turns out it is super-simple, but does require editing the functions.php file. You simply add the following:

add_filter('widget_text', 'do_shortcode');