WordPress.org

Make WordPress Core

Changeset 38374


Ignore:
Timestamp:
08/26/2016 05:52:05 PM (3 years ago)
Author:
wonderboymusic
Message:

Load: remove class-feed.php (There is no class named Feed or WP_Feed, it just loads other classes) and, instead, move the require calls to the only place they are ever included: inside fetch_feed(). This simplifies the include path.

Tested with this feed in a widget: http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml.

See #36335.

Location:
trunk/src
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r38373 r38374  
    707707'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
    708708// 4.7
     709'wp-includes/class-feed.php',
    709710'wp-includes/locale.php',
    710711'wp-includes/session.php',
  • trunk/src/wp-includes/feed.php

    r38056 r38374  
    664664 */
    665665function fetch_feed( $url ) {
    666     require_once( ABSPATH . WPINC . '/class-feed.php' );
     666    if ( ! class_exists( 'SimplePie', false ) ) {
     667        require_once( ABSPATH . WPINC . '/class-simplepie.php' );
     668    }
     669    require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
     670    require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
     671    require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
     672    require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );
    667673
    668674    $feed = new SimplePie();
     
    677683
    678684    $feed->set_feed_url( $url );
    679     /** This filter is documented in wp-includes/class-feed.php */
     685    /** This filter is documented in wp-includes/class-wp-feed-cache-transient.php */
    680686    $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );
    681687    /**
Note: See TracChangeset for help on using the changeset viewer.