Make WordPress Core

Ticket #29204: 29204.diff

File 29204.diff, 1.6 KB (added by dd32, 10 years ago)
  • src/wp-includes/feed.php

     
    614614 * using SimplePie's multifeed feature.
    615615 * See also {@link ​http://simplepie.org/wiki/faq/typical_multifeed_gotchas}
    616616 *
    617617 * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
    618618 */
    619619function fetch_feed( $url ) {
    620620        require_once( ABSPATH . WPINC . '/class-feed.php' );
    621621
    622622        $feed = new SimplePie();
    623623
    624624        $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
    625625        // We must manually overwrite $feed->sanitize because SimplePie's
    626626        // constructor sets it before we have a chance to set the sanitization class
    627627        $feed->sanitize = new WP_SimplePie_Sanitize_KSES();
    628628
    629         $feed->set_cache_class( 'WP_Feed_Cache' );
     629        SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' );
     630        $feed->set_cache_location( 'wp_transient://' . $url );
     631       
    630632        $feed->set_file_class( 'WP_SimplePie_File' );
    631633
    632634        $feed->set_feed_url( $url );
    633635        /** This filter is documented in wp-includes/class-feed.php */
    634636        $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );
    635637        /**
    636638         * Fires just before processing the SimplePie feed object.
    637639         *
    638640         * @since 3.0.0
    639641         *
    640642         * @param object &$feed SimplePie feed object, passed by reference.
    641643         * @param mixed  $url   URL of feed to retrieve. If an array of URLs, the feeds are merged.
    642644         */
    643645        do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
    644646        $feed->init();