WordPress.org

Make WordPress Core

Ticket #29204: 29204.3.diff

File 29204.3.diff, 1.3 KB (added by afragen, 13 months ago)

Combine patches from @dd32 and @ComputerGuru

  • wp-includes/class-wp-feed-cache.php

    diff --git a/wp-includes/class-wp-feed-cache.php b/wp-includes/class-wp-feed-cache.php
    index 2564dffb80..aad0143fb1 100644
    a b  
    1414 *
    1515 * @see SimplePie_Cache
    1616 */
    17 class WP_Feed_Cache extends SimplePie_Cache {
     17class WP_Feed_Cache {
    1818
    1919        /**
    2020         * Creates a new SimplePie_Cache object.
    class WP_Feed_Cache extends SimplePie_Cache { 
    2626         * @param string $extension 'spi' or 'spc'.
    2727         * @return WP_Feed_Cache_Transient Feed cache handler object that uses transients.
    2828         */
    29         public function create( $location, $filename, $extension ) {
     29        public static function create( $location, $filename, $extension ) {
    3030                return new WP_Feed_Cache_Transient( $location, $filename, $extension );
    3131        }
    3232}
  • wp-includes/feed.php

    diff --git a/wp-includes/feed.php b/wp-includes/feed.php
    index 0b84cc10a5..555442e08c 100644
    a b function fetch_feed( $url ) { 
    801801        // constructor sets it before we have a chance to set the sanitization class.
    802802        $feed->sanitize = new WP_SimplePie_Sanitize_KSES();
    803803
     804        SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' );
     805        $feed->set_cache_location( 'wp_transient://' . $url );
    804806        $feed->set_cache_class( 'WP_Feed_Cache' );
    805807        $feed->set_file_class( 'WP_SimplePie_File' );
    806808