Support » Alpha/Beta/RC » feed.php fails in 3.5

  • Resolved jquindlen


    Code that previously worked without issue over the last several years has broke in 3.5. Specifically, parsing feeds with SimplePie is no longer working for me in multiple plugins. For instance, this code works in 3.4, but not 3.5:

    $maxitems = 0;
    @include_once(ABSPATH . WPINC . '/feed.php');
    @$rss = fetch_feed('');
    if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
        // Figure out how many total items there are, but limit it to 2.
        $maxitems = $rss->get_item_quantity(3);
        // Build an array of all the items, starting with element 0 (first element).
        $rss_items = $rss->get_items(0, $maxitems);
    echo '<ul>';
        if (@$maxitems == 0) {
            echo '<li>'.__('No items', 'wpstorecart').'</li>';
        } else {
            // Loop through each feed item and display each item as a hyperlink.
            foreach ( $rss_items as $item ) {
                echo '<li><a style="font-weight:bold;font-size:120%;" target="_blank" href="'. $item->get_permalink() .'" title="Posted">'.$item->get_title().'</a><br />'.$item->get_description().'</li>';
    echo '</ul>';

    The code dies inside the foreach() statement. I’ve looked inside the /feed.php in the repository and see that it has undergone some modifications. Any clue as to what’s going and whether this will be fixed?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘feed.php fails in 3.5’ is closed to new replies.