]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/dashboard.php
Wordpress 2.8.2
[autoinstalls/wordpress.git] / wp-admin / includes / dashboard.php
index ec93fb0d095d924f60223681eaf032521bfb4be0..56c5581ef8306ce12610387c61adccb3f29c9fb9 100644 (file)
@@ -605,7 +605,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
 }
 
 function wp_dashboard_incoming_links() {
-       wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );
+       echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
 }
 
 /**
@@ -634,8 +634,10 @@ function wp_dashboard_incoming_links_output() {
 
        echo "<ul>\n";
 
-       $count = 0;
-       foreach ( $rss->get_items() as $item ) {
+       if ( !isset($items) )
+               $items = 10;
+
+       foreach ( $rss->get_items(0, $items) as $item ) {
                $publisher = '';
                $site_link = '';
                $link = '';
@@ -644,10 +646,14 @@ function wp_dashboard_incoming_links_output() {
                $link = esc_url( strip_tags( $item->get_link() ) );
 
                $author = $item->get_author();
-               $site_link = esc_url( strip_tags( $author->get_link() ) );
+               if ( $author ) {
+                       $site_link = esc_url( strip_tags( $author->get_link() ) );
 
-               if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) )
-                       $publisher = __( 'Somebody' );
+                       if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) )
+                               $publisher = __( 'Somebody' );
+               } else {
+                 $publisher = __( 'Somebody' );
+               }
                if ( $site_link )
                        $publisher = "<a href='$site_link'>$publisher</a>";
                else
@@ -684,7 +690,7 @@ function wp_dashboard_incoming_links_control() {
 }
 
 function wp_dashboard_primary() {
-       wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
+       echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
 }
 
 function wp_dashboard_primary_control() {
@@ -706,7 +712,7 @@ function wp_dashboard_rss_output( $widget_id ) {
 }
 
 function wp_dashboard_secondary() {
-       wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
+       echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
 }
 
 function wp_dashboard_secondary_control() {
@@ -741,11 +747,7 @@ function wp_dashboard_secondary_output() {
 }
 
 function wp_dashboard_plugins() {
-       wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
-               'http://wordpress.org/extend/plugins/rss/browse/popular/',
-               'http://wordpress.org/extend/plugins/rss/browse/new/',
-               'http://wordpress.org/extend/plugins/rss/browse/updated/'
-       ) );
+       echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
 }
 
 /**