Index: src/wp-includes/widgets.php
===================================================================
--- src/wp-includes/widgets.php	(revision 38762)
+++ src/wp-includes/widgets.php	(working copy)
@@ -214,22 +214,28 @@
  * @param array|string $args {
  *     Optional. Array or string of arguments for the sidebar being registered.
  *
- *     @type string $name          The name or title of the sidebar displayed in the Widgets
- *                                 interface. Default 'Sidebar $instance'.
- *     @type string $id            The unique identifier by which the sidebar will be called.
- *                                 Default 'sidebar-$instance'.
- *     @type string $description   Description of the sidebar, displayed in the Widgets interface.
- *                                 Default empty string.
- *     @type string $class         Extra CSS class to assign to the sidebar in the Widgets interface.
- *                                 Default empty.
- *     @type string $before_widget HTML content to prepend to each widget's HTML output when
- *                                 assigned to this sidebar. Default is an opening list item element.
- *     @type string $after_widget  HTML content to append to each widget's HTML output when
- *                                 assigned to this sidebar. Default is a closing list item element.
- *     @type string $before_title  HTML content to prepend to the sidebar title when displayed.
- *                                 Default is an opening h2 element.
- *     @type string $after_title   HTML content to append to the sidebar title when displayed.
- *                                 Default is a closing h2 element.
+ *     @type string $name           The name or title of the sidebar displayed in the Widgets
+ *                                  interface. Default 'Sidebar $instance'.
+ *     @type string $id             The unique identifier by which the sidebar will be called.
+ *                                  Default 'sidebar-$instance'.
+ *     @type string $description    Description of the sidebar, displayed in the Widgets interface.
+ *                                  Default is an empty string.
+ *     @type string $class          Extra CSS class to assign to the sidebar in the Widgets interface.
+ *                                  Default is an empty string.
+ *     @type string $before_widget  HTML content to prepend to each widget's HTML output when
+ *                                  assigned to this sidebar. Default is an opening list item element.
+ *     @type string $after_widget   HTML content to append to each widget's HTML output when
+ *                                  assigned to this sidebar. Default is a closing list item element.
+ *     @type string $before_title   HTML content to prepend to the sidebar title when displayed.
+ *                                  Default is an opening h2 element.
+ *     @type string $after_title    HTML content to append to the sidebar title when displayed.
+ *                                  Default is a closing h2 element.
+ *     @type string $before_sidebar HTML content to prepend to the sidebar.
+ *                                  Outputs after the dynamic_sidebar_before action.
+ *                                  Default is an empty string.
+ *     @type string $after_sidebar  HTML content to append to the sidebar when displayed.
+ *                                  Outputs before the dynamic_sidebar_after action.
+ *                                  Default is an empty string.
  * }
  * @return string Sidebar ID added to $wp_registered_sidebars global.
  */
@@ -249,6 +255,8 @@
 		'after_widget' => "</li>\n",
 		'before_title' => '<h2 class="widgettitle">',
 		'after_title' => "</h2>\n",
+		'before_sidebar' => '',
+		'after_sidebar' => '',
 	);
 
 	$sidebar = wp_parse_args( $args, $defaults );
@@ -635,6 +643,9 @@
 		return apply_filters( 'dynamic_sidebar_has_widgets', false, $index );
 	}
 
+	$sidebar = $wp_registered_sidebars[$index];
+  $sidebar['before_sidebar'] = sprintf( $sidebar['before_sidebar'], $sidebar['id'], $sidebar['class'] );
+
 	/**
 	 * Fires before widgets are rendered in a dynamic sidebar.
 	 *
@@ -648,8 +659,11 @@
 	 *                                Default true.
 	 */
 	do_action( 'dynamic_sidebar_before', $index, true );
-	$sidebar = $wp_registered_sidebars[$index];
 
+	if ( ! empty( $sidebar['before_sidebar'] ) ) {
+     			echo $sidebar['before_sidebar'];
+  }
+
 	$did_one = false;
 	foreach ( (array) $sidebars_widgets[$index] as $id ) {
 
@@ -740,6 +754,10 @@
 		}
 	}
 
+	if ( ! empty( $sidebar['after_sidebar'] ) ) {
+	 	      echo $sidebar['after_sidebar'];
+	}
+
 	/**
 	 * Fires after widgets are rendered in a dynamic sidebar.
 	 *
