Filter hook 'wp_feed_cache_transient_lifetime'
in WP Core File wp-includes/feed.php at line 828
Description
Builds SimplePie object based on RSS or Atom feed from URL. / function fetch_feed( $url ) { if ( ! class_exists( 'SimplePie', false ) ) { require_once ABSPATH . WPINC . '/class-simplepie.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(); $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); /* We must manually overwrite $feed->sanitize because SimplePie's constructor sets it before we have a chance to set the sanitization class.
Occurrences
Filename |
Line Number |
wp-includes/feed.php |
828 |
wp-includes/class-wp-feed-cache-transient.php |
67 |
Parameters
Type |
Name |
Description |
string|string[] |
$url |
URL of feed to retrieve. If an array of URLs, the feeds are merged using SimplePie's multifeed feature. See also {@link http://simplepie.org/wiki/faq/typical_multifeed_gotchas} |
PHP Doc
/**
* Builds SimplePie object based on RSS or Atom feed from URL.
*
* @since 2.8.0
*
* @param string|string[] $url URL of feed to retrieve. If an array of URLs, the feeds are merged
* using SimplePie's multifeed feature.
* See also {@link http://simplepie.org/wiki/faq/typical_multifeed_gotchas}
* @return SimplePie|WP_Error SimplePie object on success or WP_Error object on failure.
*/
function fetch_feed( $url ) {
if ( ! class_exists( 'SimplePie', false ) ) {
require_once ABSPATH . WPINC . '/class-simplepie.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();
$feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
/*
* We must manually overwrite $feed->sanitize because SimplePie's constructor
* sets it before we have a chance to set the sanitization class.
*/