<!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" />
<title>[26220] trunk/src/wp-admin: Dash cleanup.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26220">26220</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2013-11-15 20:14:44 +0000 (Fri, 15 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Dash cleanup.
 * Use wp_add_dashboard_widget() rather than add_meta_box().
 * Use original functions like wp_dashboard_primary(), wp_dashboard_right_now(), wp_dashboard_quick_press() (where possible).
 * Only include plugins section of the news widget when appropriate, which necessitates the set_current_screen() via the ajax action.
 * Remove some debug cruft that was preventing caching and invalidation.
 * Simplify lots of things where possible.
see <a href="http://core.trac.wordpress.org/ticket/25824">#25824</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsswpadmincss">trunk/src/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesdeprecatedphp">trunk/src/wp-admin/includes/deprecated.php</a></li>
<li><a href="#trunksrcwpadminjsdashboardjs">trunk/src/wp-admin/js/dashboard.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/wp-admin.css (26219 => 26220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/wp-admin.css      2013-11-15 19:53:50 UTC (rev 26219)
+++ trunk/src/wp-admin/css/wp-admin.css 2013-11-15 20:14:44 UTC (rev 26220)
</span><span class="lines">@@ -2969,19 +2969,19 @@
</span><span class="cx"> 
</span><span class="cx"> /* Dashboard Quick Draft */
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft div.updated {
</del><ins>+#dashboard_quick_press div.updated {
</ins><span class="cx">   margin-bottom: 10px;
</span><span class="cx">  border: 1px solid #eee;
</span><span class="cx">  border-width: 1px 1px 1px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft form {
</del><ins>+#dashboard_quick_press form {
</ins><span class="cx">   padding: 0 12px 1px 12px;
</span><span class="cx">  overflow: hidden;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft .drafts,
-#dashboard_quick_draft .easy-blogging {
</del><ins>+#dashboard_quick_press .drafts,
+#dashboard_quick_press .easy-blogging {
</ins><span class="cx">   padding: 8px 12px 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3012,15 +3012,15 @@
</span><span class="cx">  height: auto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft input,
-#dashboard_quick_draft textarea {
</del><ins>+#dashboard_quick_press input,
+#dashboard_quick_press textarea {
</ins><span class="cx">   box-sizing: border-box;
</span><span class="cx">  -moz-box-sizing:border-box;
</span><span class="cx">  -webkit-box-sizing:border-box;
</span><span class="cx">  margin: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft textarea {
</del><ins>+#dashboard_quick_press textarea {
</ins><span class="cx">   resize: vertical;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3070,21 +3070,21 @@
</span><span class="cx"> 
</span><span class="cx"> /* Dashboard Quick Draft - Drafts list */
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft .drafts {
</del><ins>+#dashboard_quick_press .drafts {
</ins><span class="cx">   border-top: 1px solid #eee;
</span><span class="cx">  margin-top: 12px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft .drafts abbr {
</del><ins>+#dashboard_quick_press .drafts abbr {
</ins><span class="cx">   border: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft .drafts h4 {
</del><ins>+#dashboard_quick_press .drafts h4 {
</ins><span class="cx">   margin: 0 0 8px 0;
</span><span class="cx">  font-weight: normal;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#dashboard_quick_draft .drafts .view-all {
</del><ins>+#dashboard_quick_press .drafts .view-all {
</ins><span class="cx">   float: right;
</span><span class="cx">  margin-top: 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (26219 => 26220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php     2013-11-15 19:53:50 UTC (rev 26219)
+++ trunk/src/wp-admin/includes/ajax-actions.php        2013-11-15 20:14:44 UTC (rev 26220)
</span><span class="lines">@@ -233,9 +233,14 @@
</span><span class="cx"> function wp_ajax_dashboard_widgets() {
</span><span class="cx">  require_once ABSPATH . 'wp-admin/includes/dashboard.php';
</span><span class="cx"> 
</span><ins>+       $pagenow = $_GET['pagenow'];
+       if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) {
+               set_current_screen( $pagenow );
+       }
+
</ins><span class="cx">   switch ( $_GET['widget'] ) {
</span><del>-               case 'dashboard_rss' :
-                       wp_dashboard_rss();
</del><ins>+                case 'dashboard_primary' :
+                       wp_dashboard_primary();
</ins><span class="cx">                   break;
</span><span class="cx">  }
</span><span class="cx">  wp_die();
</span></span></pre></div>
<a id="trunksrcwpadminincludesdashboardphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/dashboard.php (26219 => 26220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/dashboard.php        2013-11-15 19:53:50 UTC (rev 26219)
+++ trunk/src/wp-admin/includes/dashboard.php   2013-11-15 20:14:44 UTC (rev 26220)
</span><span class="lines">@@ -37,20 +37,20 @@
</span><span class="cx"> 
</span><span class="cx">  // Right Now
</span><span class="cx">  if ( is_blog_admin() && current_user_can('edit_posts') )
</span><del>-               add_meta_box( 'dash-right-now', 'Site Content', 'dashboard_new_right_now', 'dashboard', 'normal', 'high' );
</del><ins>+                wp_add_dashboard_widget( 'dash-right-now', __( 'Site Content' ), 'wp_dashboard_right_now' );
</ins><span class="cx"> 
</span><span class="cx">  if ( is_network_admin() )
</span><span class="cx">          wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
</span><span class="cx"> 
</span><span class="cx">  // Activity Widget
</span><del>-       add_meta_box( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity', 'dashboard', 'normal', 'high' );
</del><ins>+        wp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity' );
</ins><span class="cx"> 
</span><span class="cx">  // QuickPress Widget
</span><span class="cx">  if ( is_blog_admin() && current_user_can( 'edit_posts' ) )
</span><del>-               add_meta_box( 'dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high' );
</del><ins>+                wp_add_dashboard_widget( 'dashboard_quick_press', __( 'Quick Draft' ), 'wp_dashboard_quick_press' );
</ins><span class="cx"> 
</span><span class="cx">  // WordPress News
</span><del>-       add_meta_box( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'dashboard', 'side', 'low' );
</del><ins>+        wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress News' ), 'wp_dashboard_primary' );
</ins><span class="cx"> 
</span><span class="cx">  // Hook to register new widgets
</span><span class="cx">  // Filter widget order
</span><span class="lines">@@ -104,12 +104,7 @@
</span><span class="cx">          }
</span><span class="cx">  }
</span><span class="cx"> 
</span><del>-       if ( is_blog_admin () )
-               $side_widgets = array('dashboard_quick_draft');
-       else if (is_network_admin() )
-               $side_widgets = array();
-       else
-               $side_widgets = array();
</del><ins>+        $side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' );
</ins><span class="cx"> 
</span><span class="cx">  $location = 'normal';
</span><span class="cx">  if ( in_array($widget_id, $side_widgets) )
</span><span class="lines">@@ -118,6 +113,8 @@
</span><span class="cx">  $priority = 'core';
</span><span class="cx">  if ( 'dashboard_browser_nag' === $widget_id )
</span><span class="cx">          $priority = 'high';
</span><ins>+       elseif ( 'dashboard_primary' === $widget_id )
+               $priority = 'low';
</ins><span class="cx"> 
</span><span class="cx">  add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args );
</span><span class="cx"> }
</span><span class="lines">@@ -164,7 +161,14 @@
</span><span class="cx"> 
</span><span class="cx"> /* Dashboard Widgets */
</span><span class="cx"> 
</span><del>-function dashboard_new_right_now() {
</del><ins>+/**
+ * Dashboard widget that displays some basic stats about the site.
+ *
+ * Formerly 'Right Now'. A streamlined 'Site Content' as of 3.8.
+ *
+ * @since 2.7.0
+ */
+function wp_dashboard_right_now() {
</ins><span class="cx">   $theme = wp_get_theme();
</span><span class="cx">  if ( current_user_can( 'switch_themes' ) )
</span><span class="cx">          $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme->display('Name') );
</span><span class="lines">@@ -283,7 +287,7 @@
</span><span class="cx">  * @since 3.8.0
</span><span class="cx">  *
</span><span class="cx">  */
</span><del>-function wp_dashboard_quick_draft( $error_msg=false ) {
</del><ins>+function wp_dashboard_quick_press( $error_msg=false ) {
</ins><span class="cx">   global $post_ID;
</span><span class="cx"> 
</span><span class="cx">  /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
</span><span class="lines">@@ -305,8 +309,6 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  $post_ID = (int) $post->ID;
</span><del>-
-       do_action( 'dashboard_quickdraft_beginning', $post );
</del><span class="cx"> ?>
</span><span class="cx"> 
</span><span class="cx">  <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form">
</span><span class="lines">@@ -338,8 +340,6 @@
</span><span class="cx"> 
</span><span class="cx"> <?php
</span><span class="cx">  wp_dashboard_recent_quickdrafts();
</span><del>-
-       do_action( 'dashboard_quickdraft_end' );
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -677,6 +677,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Display generic dashboard RSS widget feed.
+ *
+ * @since 2.5.0
+ *
+ * @param string $widget_id
+ */
+function wp_dashboard_rss_output( $widget_id ) {
+       $widgets = get_option( 'dashboard_widget_options' );
+       echo '<div class="rss-widget">';
+       wp_widget_rss_output( $widgets[ $widget_id ] );
+       echo "</div>";
+}
+
+/**
</ins><span class="cx">  * Checks to see if all of the feed url in $check_urls are cached.
</span><span class="cx">  *
</span><span class="cx">  * If $check_urls is empty, look for the rss feed url found in the dashboard
</span><span class="lines">@@ -745,15 +759,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Returns default WordPress News feeds
</del><ins>+ * WordPress News dashboard widget.
</ins><span class="cx">  *
</span><del>- *
- *
- * @since 3.8.0
- *
</del><ins>+ * @since 2.7.0
</ins><span class="cx">  */
</span><del>-function wp_dashboard_default_feeds() {
-       return array(
</del><ins>+function wp_dashboard_primary() {
+       $feeds = array(
</ins><span class="cx">           'news'   => array(
</span><span class="cx">                  'link'         => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
</span><span class="cx">                  'url'          => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
</span><span class="lines">@@ -771,161 +782,120 @@
</span><span class="cx">                  'show_summary' => 0,
</span><span class="cx">                  'show_author'  => 0,
</span><span class="cx">                  'show_date'    => 0,
</span><del>-               ),
-               'plugins' => array(
</del><ins>+                )
+       );
+
+       if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
+               $feeds['plugins'] = array(
</ins><span class="cx">                   'link'         => '',
</span><span class="cx">                  'url'          => array(
</span><del>-                                       'popular' => 'http://wordpress.org/plugins/rss/browse/popular/'
</del><ins>+                                'popular' => 'http://wordpress.org/plugins/rss/browse/popular/',
</ins><span class="cx">                   ),
</span><span class="cx">                  'title'        => '',
</span><span class="cx">                  'items'        => 1,
</span><span class="cx">                  'show_summary' => 0,
</span><span class="cx">                  'show_author'  => 0,
</span><span class="cx">                  'show_date'    => 0,
</span><del>-               )
-       );
-}
-
-/**
- * Check for cached feeds
- *
- *
- *
- * @since 3.8.0
- *
- */
-function wp_dashboard_rss() {
-       $default_feeds = wp_dashboard_default_feeds();
-
-       $widget_options = get_option( 'dashboard_widget_options' );
-
-       if ( !$widget_options || !is_array($widget_options) )
-               $widget_options = array();
-
-       //if ( ! isset( $widget_options['dashboard_rss'] ) ) {
-               $widget_options['dashboard_rss'] = $default_feeds;
-               update_option( 'dashboard_widget_options', $widget_options );
-       //}
-
-       foreach( $default_feeds as $key => $value ) {
-               $default_urls[] = $value['url'];
</del><ins>+                );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><del>-       $cache_key = 'dash_' . md5( 'dashboard_rss' );
-       delete_transient( $cache_key );
-
-       do_action( 'dashboard_news_beginning' );
-
-       wp_dashboard_cached_rss_widget( 'dashboard_rss', 'wp_dashboard_news_output', $default_urls );
-
-       do_action( 'dashboard_news_end' );
</del><ins>+        wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Display news feeds
</del><ins>+ * Display the WordPress news feeds.
</ins><span class="cx">  *
</span><del>- *
- *
</del><span class="cx">  * @since 3.8.0
</span><del>- *
</del><span class="cx">  */
</span><del>-function wp_dashboard_news_output() {
-       $widgets = get_option( 'dashboard_widget_options' );
-
-       foreach( $widgets['dashboard_rss'] as $type => $args ) {
</del><ins>+function wp_dashboard_primary_output( $widget_id, $feeds ) {
+       foreach( $feeds as $type => $args ) {
</ins><span class="cx">           $args['type'] = $type;
</span><span class="cx">          echo '<div class="rss-widget">';
</span><del>-               wp_widget_news_output( $args['url'], $args );
</del><ins>+                if ( $type === 'plugins' ) {
+                       wp_dashboard_plugins_output( $args['url'], $args );
+               } else {
+                       wp_widget_rss_output( $args['url'], $args );
+               }
</ins><span class="cx">           echo "</div>";
</span><span class="cx">  }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Generate code for each news feed
</del><ins>+ * Display plugins text for the WordPress news widget.
</ins><span class="cx">  *
</span><del>- *
- *
- * @since 3.8.0
- *
</del><ins>+ * @since 2.5.0
</ins><span class="cx">  */
</span><del>-function wp_widget_news_output( $rss, $args = array() ) {
</del><ins>+function wp_dashboard_plugins_output( $rss, $args = array() ) {
+       // Plugin feeds plus link to install them
+       $popular = fetch_feed( $args['url']['popular'] );
</ins><span class="cx"> 
</span><del>-       // Regular RSS feeds
-       if ( isset( $args['type'] ) && 'plugins' != $args['type'] )
-               return wp_widget_rss_output( $rss, $args );
</del><ins>+        if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
+               $plugin_slugs = array_keys( get_plugins() );
+               set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
+       }
</ins><span class="cx"> 
</span><del>-       // Plugin feeds plus link to install them
-       if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {
-               $popular = fetch_feed( $args['url']['popular'] );
</del><ins>+        echo '<ul>';
</ins><span class="cx"> 
</span><del>-               if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
-                       $plugin_slugs = array_keys( get_plugins() );
-                       set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
-               }
</del><ins>+        foreach ( array(
+               'popular' => __( 'Popular Plugin' )
+       ) as $feed => $label ) {
+               if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )
+                       continue;
</ins><span class="cx"> 
</span><del>-               echo '<ul>';
</del><ins>+                $items = $$feed->get_items(0, 5);
</ins><span class="cx"> 
</span><del>-               foreach ( array(
-                       'popular' => __( 'Popular Plugin' )
-               ) as $feed => $label ) {
-                       if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )
-                               continue;
</del><ins>+                // Pick a random, non-installed plugin
+               while ( true ) {
+                       // Abort this foreach loop iteration if there's no plugins left of this type
+                       if ( 0 == count($items) )
+                               continue 2;
</ins><span class="cx"> 
</span><del>-                       $items = $$feed->get_items(0, 5);
</del><ins>+                        $item_key = array_rand($items);
+                       $item = $items[$item_key];
</ins><span class="cx"> 
</span><del>-                       // Pick a random, non-installed plugin
-                       while ( true ) {
-                               // Abort this foreach loop iteration if there's no plugins left of this type
-                               if ( 0 == count($items) )
-                                       continue 2;
</del><ins>+                        list($link, $frag) = explode( '#', $item->get_link() );
</ins><span class="cx"> 
</span><del>-                               $item_key = array_rand($items);
-                               $item = $items[$item_key];
</del><ins>+                        $link = esc_url($link);
+                       if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
+                               $slug = $matches[1];
+                       else {
+                               unset( $items[$item_key] );
+                               continue;
+                       }
</ins><span class="cx"> 
</span><del>-                               list($link, $frag) = explode( '#', $item->get_link() );
-
-                               $link = esc_url($link);
-                               if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
-                                       $slug = $matches[1];
-                               else {
</del><ins>+                        // Is this random plugin's slug already installed? If so, try again.
+                       reset( $plugin_slugs );
+                       foreach ( $plugin_slugs as $plugin_slug ) {
+                               if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
</ins><span class="cx">                                   unset( $items[$item_key] );
</span><del>-                                       continue;
</del><ins>+                                        continue 2;
</ins><span class="cx">                           }
</span><del>-
-                               // Is this random plugin's slug already installed? If so, try again.
-                               reset( $plugin_slugs );
-                               foreach ( $plugin_slugs as $plugin_slug ) {
-                                       if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
-                                               unset( $items[$item_key] );
-                                               continue 2;
-                                       }
-                               }
-
-                               // If we get to this point, then the random plugin isn't installed and we can stop the while().
-                               break;
</del><span class="cx">                   }
</span><span class="cx"> 
</span><del>-                       // Eliminate some common badly formed plugin descriptions
-                       while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
-                               unset($items[$item_key]);
</del><ins>+                        // If we get to this point, then the random plugin isn't installed and we can stop the while().
+                       break;
+               }
</ins><span class="cx"> 
</span><del>-                       if ( !isset($items[$item_key]) )
-                               continue;
</del><ins>+                // Eliminate some common badly formed plugin descriptions
+               while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
+                       unset($items[$item_key]);
</ins><span class="cx"> 
</span><del>-                       $title = esc_html( $item->get_title() );
</del><ins>+                if ( !isset($items[$item_key]) )
+                       continue;
</ins><span class="cx"> 
</span><del>-                       $description = esc_html( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );
</del><ins>+                $title = esc_html( $item->get_title() );
</ins><span class="cx"> 
</span><del>-                       $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
</del><ins>+                $description = esc_html( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );
</ins><span class="cx"> 
</span><del>-                       echo "<li class='dashboard-news-plugin'><span>$label:</span> <a href='$link' class='dashboard-news-plugin-link'>$title</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span></li>";
</del><ins>+                $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
</ins><span class="cx"> 
</span><del>-                       $$feed->__destruct();
-                       unset( $$feed );
-               }
</del><ins>+                echo "<li class='dashboard-news-plugin'><span>$label:</span> <a href='$link' class='dashboard-news-plugin-link'>$title</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span></li>";
</ins><span class="cx"> 
</span><del>-               echo '</ul>';
</del><ins>+                $$feed->__destruct();
+               unset( $$feed );
</ins><span class="cx">   }
</span><ins>+
+       echo '</ul>';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunksrcwpadminincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/deprecated.php (26219 => 26220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/deprecated.php       2013-11-15 19:53:50 UTC (rev 26219)
+++ trunk/src/wp-admin/includes/deprecated.php  2013-11-15 20:14:44 UTC (rev 26220)
</span><span class="lines">@@ -730,7 +730,7 @@
</span><span class="cx">  */
</span><span class="cx"> function wp_dashboard_quick_press_output() {
</span><span class="cx">  _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
</span><del>-       wp_dashboard_quick_draft();
</del><ins>+        wp_dashboard_quick_press();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunksrcwpadminjsdashboardjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/dashboard.js (26219 => 26220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/dashboard.js       2013-11-15 19:53:50 UTC (rev 26219)
+++ trunk/src/wp-admin/js/dashboard.js  2013-11-15 20:14:44 UTC (rev 26220)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+/* global pagenow */
</ins><span class="cx"> var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
</span><span class="cx"> 
</span><span class="cx"> jQuery(document).ready( function($) {
</span><span class="lines">@@ -28,9 +29,7 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  // These widgets are sometimes populated via ajax
</span><del>-       ajaxWidgets = [
-               'dashboard_rss'
-       ];
</del><ins>+        ajaxWidgets = ['dashboard_primary'];
</ins><span class="cx"> 
</span><span class="cx">  ajaxPopulateWidgets = function(el) {
</span><span class="cx">          function show(i, id) {
</span><span class="lines">@@ -38,7 +37,7 @@
</span><span class="cx">                  if ( e.length ) {
</span><span class="cx">                          p = e.parent();
</span><span class="cx">                          setTimeout( function(){
</span><del>-                                       p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id, '', function() {
</del><ins>+                                        p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id + '&pagenow=' + pagenow, '', function() {
</ins><span class="cx">                                           p.hide().slideDown('normal', function(){
</span><span class="cx">                                                  $(this).css('display', '');
</span><span class="cx">                                          });
</span></span></pre>
</div>
</div>

</body>
</html>