WordPress.org

Make WordPress Core

Changeset 10742


Ignore:
Timestamp:
03/08/2009 05:01:26 AM (9 years ago)
Author:
azaozz
Message:

Better error handling and display in the RSS widget, props DD32, fixes #8495

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r10739 r10742  
    17651765    $show_author    = (int) $show_author;
    17661766    $show_date      = (int) $show_date;
     1767
     1768    if ( !empty($error) ) {
     1769        $message = sprintf( __('Error in RSS Widget: %s'), $error);
     1770        echo "<div class='error'><p>$message</p></div>";
     1771        echo "<p class='hide-if-no-js'><strong>$message</strong></p>";
     1772    }
    17671773
    17681774    if ( $inputs['url'] ) :
     
    18551861        $link = '';
    18561862        if ( is_wp_error($rss) ) {
    1857             $url = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1);
    1858             $error = sprintf(__('Error in RSS %1$d'), $widget_number );
     1863            $error = $rss->get_error_message();
    18591864        } else {
    18601865            $link = clean_url(strip_tags($rss->get_permalink()));
Note: See TracChangeset for help on using the changeset viewer.