Add HTML tags to WordPress widget title

Adding HTML tags to wordpress widget titles is not allowed, they are removed when saving them in the database.

This small snippet of code helps you to add HTML to the widget title. The code snippet makes it possible to use tags like [html] and [/html] in widget title and convert them.

function html_widget_title( $title ) {

 // opening html
 $title = str_replace( '[html]', '<span class="class">', $title );
 // ending html
 $title = str_replace( '[/html]', '</span>', $title );
 return $title;
add_filter( 'widget_title', 'html_widget_title' );

So, what do you think ?