Changeset 10739 for trunk/wp-admin/includes/dashboard.php
- Timestamp:
- 03/07/2009 07:44:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r10738 r10739 604 604 $rss = fetch_feed( $url ); 605 605 606 if ( is_wp_error($rss) ) { 607 if ( is_admin() || current_user_can('manage_options') ) { 608 echo '<p>'; 609 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 610 echo '</p>'; 611 } 612 return; 613 } 614 606 615 if ( !$rss->get_item_quantity() ) { 607 616 echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "</p>\n"; … … 741 750 742 751 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) { 743 if ( !$$feed->get_item_quantity() )752 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() ) 744 753 continue; 745 754 … … 899 908 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 900 909 $rss = fetch_feed($widget_options[$widget_id]['url']); 901 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); 910 if ( ! is_wp_error($rss) ) 911 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); 912 else 913 $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed')); 902 914 } 903 915 update_option( 'dashboard_widget_options', $widget_options );
Note: See TracChangeset
for help on using the changeset viewer.