Monday, July 3, 2006

close visual rich editor of wordpress 2.0

The option of “Users should use the visual rich editor by default” is unusable in wordcodess 2.0 default.So we need close it by hand.For example,i close it for firefox and Opera 2-9 as bellow.

modify the function “user_can_richedit” in wp-admin/admin-functions.php


function user_can_richedit() {
if ( 'true' != get_user_option('rich_editing') )
return false;

if ( codeg_match('!opera[ /][2-9]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) )
return false;

return true; // Best guess
}
?>

as:

function user_can_richedit() {
if ( 'true' != get_user_option('rich_editing') )
return false;

if ( codeg_match('!opera[ /][2-9]|konqueror|Firefox|safari!i', $_SERVER['HTTP_USER_AGENT']) )
return false;

return true; // Best guess
}
?>

No comments:

Post a Comment