<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12213] trunk:
  Add sidebar descriptions to sidebar settings and widget admin screen,
  props jeremyclarke scribu, fixes #11157</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12213">12213</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-11-19 09:12:16 +0000 (Thu, 19 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add sidebar descriptions to sidebar settings and widget admin screen, props jeremyclarke scribu, fixes <a href="http://trac.wordpress.org/ticket/11157">#11157</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsswidgetscss">trunk/wp-admin/css/widgets.css</a></li>
<li><a href="#trunkwpadmincsswidgetsdevcss">trunk/wp-admin/css/widgets.dev.css</a></li>
<li><a href="#trunkwpadminincludeswidgetsphp">trunk/wp-admin/includes/widgets.php</a></li>
<li><a href="#trunkwpadminwidgetsphp">trunk/wp-admin/widgets.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludeswidgetsphp">trunk/wp-includes/widgets.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsswidgetscss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/widgets.css (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/widgets.css        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-admin/css/widgets.css        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -1 +1 @@
</span><del>-html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget{width:250px;margin:0 auto 20px;overflow:hidden;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url(&quot;../images/menu-bits.gif&quot;) no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;}
</del><span class="cx">\ No newline at end of file
</span><ins>+html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden;}.widget-liquid-right .sidebar-description{margin-bottom:10px;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url(&quot;../images/menu-bits.gif&quot;) no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincsswidgetsdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/widgets.dev.css (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/widgets.dev.css        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-admin/css/widgets.dev.css        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -28,12 +28,17 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .widget-liquid-right .widget,
</span><del>-#wp_inactive_widgets .widget {
</del><ins>+#wp_inactive_widgets .widget,
+.widget-liquid-right .sidebar-description {
</ins><span class="cx">         width: 250px;
</span><span class="cx">         margin: 0 auto 20px;
</span><span class="cx">         overflow: hidden;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.widget-liquid-right .sidebar-description {
+        margin-bottom: 10px;
+}
+
</ins><span class="cx"> #wp_inactive_widgets .widget {
</span><span class="cx">         margin: 0 10px 20px;
</span><span class="cx">         float: left;
</span></span></pre></div>
<a id="trunkwpadminincludeswidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/widgets.php (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/widgets.php        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-admin/includes/widgets.php        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -52,18 +52,28 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * {@internal Missing Short Description}}
</del><ins>+ * Show the widgets and their settings for a sidebar.
+ * Used in the the admin widget config screen.
</ins><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param string $sidebar
</del><ins>+ * @param string $sidebar id slug of the sidebar
</ins><span class="cx">  */
</span><span class="cx"> function wp_list_widget_controls( $sidebar ) {
</span><span class="cx">         add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
</span><span class="cx"> 
</span><del>-        echo &quot;\t&lt;div id='$sidebar' class='widgets-sortables'&gt;\n&quot;;
</del><ins>+        echo &quot;&lt;div id='$sidebar' class='widgets-sortables'&gt;\n&quot;;
+
+        $description = wp_sidebar_description( $sidebar );
+
+        if ( !empty( $description ) ) {
+                echo &quot;&lt;div class='sidebar-description'&gt;\n&quot;;
+                echo &quot;\t&lt;p class='description'&gt;$description&lt;/p&gt;&quot;; 
+                echo &quot;&lt;/div&gt;\n&quot;;
+        }
+
</ins><span class="cx">         dynamic_sidebar( $sidebar );
</span><del>-        echo &quot;\t&lt;/div&gt;\n&quot;;
</del><ins>+        echo &quot;&lt;/div&gt;\n&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwpadminwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/widgets.php (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/widgets.php        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-admin/widgets.php        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> register_sidebar(array(
</span><span class="cx">         'name' =&gt; __('Inactive Widgets'),
</span><span class="cx">         'id' =&gt; 'wp_inactive_widgets',
</span><ins>+        'description' =&gt; '',
</ins><span class="cx">         'before_widget' =&gt; '',
</span><span class="cx">         'after_widget' =&gt; '',
</span><span class="cx">         'before_title' =&gt; '',
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-includes/script-loader.php        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx"> 
</span><span class="cx">         $styles-&gt;add( 'global', &quot;/wp-admin/css/global$suffix.css&quot;, array(), '20090630' );
</span><span class="cx">         $styles-&gt;add( 'media', &quot;/wp-admin/css/media$suffix.css&quot;, array(), '20091029' );
</span><del>-        $styles-&gt;add( 'widgets', &quot;/wp-admin/css/widgets$suffix.css&quot;, array(), '20090603' );
</del><ins>+        $styles-&gt;add( 'widgets', &quot;/wp-admin/css/widgets$suffix.css&quot;, array(), '20091118' );
</ins><span class="cx">         $styles-&gt;add( 'dashboard', &quot;/wp-admin/css/dashboard$suffix.css&quot;, array(), '20090514' );
</span><span class="cx">         $styles-&gt;add( 'install', &quot;/wp-admin/css/install$suffix.css&quot;, array(), '20090514' );
</span><span class="cx">         $styles-&gt;add( 'theme-editor', &quot;/wp-admin/css/theme-editor$suffix.css&quot;, array(), '20090625' );
</span></span></pre></div>
<a id="trunkwpincludeswidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/widgets.php (12212 => 12213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/widgets.php        2009-11-18 22:45:24 UTC (rev 12212)
+++ trunk/wp-includes/widgets.php        2009-11-19 09:12:16 UTC (rev 12213)
</span><span class="lines">@@ -544,6 +544,7 @@
</span><span class="cx">         $defaults = array(
</span><span class="cx">                 'name' =&gt; sprintf(__('Sidebar %d'), $i ),
</span><span class="cx">                 'id' =&gt; &quot;sidebar-$i&quot;,
</span><ins>+                'description' =&gt; '',
</ins><span class="cx">                 'before_widget' =&gt; '&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
</span><span class="cx">                 'after_widget' =&gt; &quot;&lt;/li&gt;\n&quot;,
</span><span class="cx">                 'before_title' =&gt; '&lt;h2 class=&quot;widgettitle&quot;&gt;',
</span><span class="lines">@@ -651,6 +652,28 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Retrieve description for a sidebar.
+ *
+ * When registering sidebars a 'description' parameter can be included that
+ * describes the sidebar for display on the widget administration panel.
+ *
+ * @since 2.9.0
+ *
+ * @param int|string $id sidebar ID.
+ * @return string Sidebar description, if available. Null on failure to retrieve description.
+ */
+function wp_sidebar_description( $id ) {
+        if ( !is_scalar($id) )
+                return;
+
+        global $wp_registered_sidebars;
+
+        if ( isset($wp_registered_sidebars[$id]['description']) )
+                return esc_html( $wp_registered_sidebars[$id]['description'] );
+}
+
+
+/**
</ins><span class="cx">  * Remove widget from sidebar.
</span><span class="cx">  *
</span><span class="cx">  * @since 2.2.0
</span></span></pre>
</div>
</div>

</body>
</html>