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.

Built from https://develop.svn.wordpress.org/trunk@38374


git-svn-id: http://core.svn.wordpress.org/trunk@38315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2016-08-26 17:53:30 +00:00
parent 524effb58f
commit 76c7864367
4 changed files with 10 additions and 18 deletions

View File

@ -706,6 +706,7 @@ $_old_files = array(
// 4.6
'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
// 4.7
'wp-includes/class-feed.php',
'wp-includes/locale.php',
'wp-includes/session.php',
);

View File

@ -1,15 +0,0 @@
<?php
/**
* Feed API
*
* @package WordPress
* @subpackage Feed
*/
if ( ! class_exists( 'SimplePie', false ) ) {
require_once( ABSPATH . WPINC . '/class-simplepie.php' );
}
require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );

View File

@ -663,7 +663,13 @@ function feed_content_type( $type = '' ) {
* @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
*/
function fetch_feed( $url ) {
require_once( ABSPATH . WPINC . '/class-feed.php' );
if ( ! class_exists( 'SimplePie', false ) ) {
require_once( ABSPATH . WPINC . '/class-simplepie.php' );
}
require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );
$feed = new SimplePie();
@ -676,7 +682,7 @@ function fetch_feed( $url ) {
$feed->set_file_class( 'WP_SimplePie_File' );
$feed->set_feed_url( $url );
/** This filter is documented in wp-includes/class-feed.php */
/** This filter is documented in wp-includes/class-wp-feed-cache-transient.php */
$feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );
/**
* Fires just before processing the SimplePie feed object.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38373';
$wp_version = '4.7-alpha-38374';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.