[wp-trac] [WordPress Trac] #64136: PHP Deprecated: Fetching multiple feeds with single SimplePie instance is deprecated since SimplePie 1.9.0
WordPress Trac
noreply at wordpress.org
Wed Oct 22 17:41:50 UTC 2025
#64136: PHP Deprecated: Fetching multiple feeds with single SimplePie instance is
deprecated since SimplePie 1.9.0
--------------------------+------------------------------
Reporter: muryam | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: administration
--------------------------+------------------------------
Comment (by ax3yui8stk):
Example change (in wp-includes/feed.php or where multiple feeds are
fetched):
{{{#!php
<?php
// Old (deprecated since SimplePie 1.9.0)
$feed = fetch_feed( array(
'https://wordpress.org/news/feed/',
'https://planet.wordpress.org/feed/'
) );
}}}
Replace with:
{{{#!php
<?php
// New: create separate instances for each feed
$feeds = array(
'https://wordpress.org/news/feed/',
'https://planet.wordpress.org/feed/',
);
$items = array();
foreach ( $feeds as $url ) {
$feed = fetch_feed( $url );
if ( ! is_wp_error( $feed ) ) {
$items = array_merge( $items, $feed->get_items( 0, 5 ) );
}
}
}}}
Result:
1. Removes the deprecation warning.
2. Keeps feed display behavior the same.
3. Future-proofs WordPress for PHP 8.3 and SimplePie 1.9+.
4. Marking this for patch and testing on WP 6.9 trunk
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64136#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list