function myclass_dynamic_sidebar_params( $params ) {
$myclass = 'myclass';
$params[0]['before_widget'] = preg_replace( '/class="/', 'class="' . $myclass . ' ', $params[0]['before_widget'], 1 );
return $params;
}
add_filter( 'dynamic_sidebar_params', 'myclass_dynamic_sidebar_params' );