WordPress Widgets from Automattic is wonderful tools to help blogging. And one of the most useful widget is Text Widget which allow we to put anything to widget-able area such as Form, Java Script, Html code, etc.,However, with Mulit-User version of Wordpress (Wordpress Mu), text widget can’t paste any tag anymore. In fact, you can paste the code to text widget, but WpMu strips it out.The problem is WpMu didn’t support “unfiltered_html“role which widget used in function widget_text_control in plugins/widgets/widgets.php as following:
So, the easiest way to solve this problem is changing line :
if ( !current_user_can(’unfiltered_html’) )
$newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text']));
to
if ( !current_user_can(’edit_themes’) )
$newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text']));
We change role from “unfiltered_html” to “edit_themes” because no reason to prevent tag/script if user can edit themes.
Another harder way is you can use Role Management plugin to add “unfiltered_html” role to WpMU.
Enjoy your widget with WpMu!!
