Tuesday, November 18, 2008

How to use HTML TAG and JAVASCRIPT in WpMu’s (WORDPRESS MU)Text widget

If you are hosting Wordpress MU now and want to enable user to insert javascript in their text widget, you must edit your wp-includes/widgets.php
Actually, it's not wise to enable this feature because user will be able to post exploit script that may harm your system.
My Wordpress MU version is 2.6.3 if you used different version just find something looks like below script in widgets.php file
if ( current_user_can('unfiltered_html') )
$text = stripslashes( $widget_text['text'] );
else
$text = stripslashes(wp_filter_post_kses( $widget_text['text'] ));
change that part of code with
if ( current_user_can('edit_themes') )
$text = stripslashes( $widget_text['text'] );
else
$text = stripslashes(wp_filter_post_kses( $widget_text['text'] ));
Got this tips from Thainy Blog. From now i will write about programming also.

0 comments: